My application has been in production for several months and everything worked fine. Howwever,
since February 24, 2023, whenever it deletes a calendar event via DELETE /me/calendars/{id}/events/{id}
, the response from Microsoft Graph includes a Transfer-Encoding
header despite this being a 204
status:
HTTP/1.1 204 No Content
Cache-Control: private
Transfer-Encoding: chunked
Strict-Transport-Security: max-age=31536000
request-id: *redacted*
client-request-id: *redacted*
x-ms-ags-diagnostic: *redacted*
Preference-Applied: IdType=ImmutableId
Date: Sun, 23 Apr 2023 10:16:44 GMT
As far as I understand section 6.1 "Transfer-Encoding" of RFC 9112, that header is illegal in this situation:
A server MUST NOT send a Transfer-Encoding header field in any response with a status code of 1xx (Informational) or 204 (No Content).
Note that the event is deleted successfully. However, due to the HTTP spec violation, the java.net.http
HTTP client throws an IOException
saying "unexpected content length header with 204 response". (Reading the source, one can see that despite the wording of that message, it is also used when a Transfer-Encoding
header is set.)
I changed my code to catch and ignore this specific exception, but this is a bad workaround as the exception being thrown still slows down the application.
So far, my production server logged 1644 occurrences of this problem; the latest one was this morning. I therefore guess these are the majority of or even all deletion requests my application issued to MS Graph.
Note: I already posted this on the Microsoft Q&A forums, but got no answers.
Questions
- Is there anything I am overlooking?
- Can anybody else confirm the presence of the
Transfer-Encoding
header? - Was this an intentional change that was announced somewhere?