Skip to content

Improve body handling for HEAD responses

Compare
Choose a tag to compare
@tanner0101 tanner0101 released this 14 Apr 18:16
bee26c5
This patch was authored and released by @tanner0101.

Improves logic for handling HEAD responses (#2310).

Previously when HEAD requests were detected, the response body would be replaced with an empty body and the content-length header would be re-added. This caused problems with responses that don't use the content-length header, even for non-HEAD requests.

Now, when HEAD requests are detected, the response body is not changed. Instead, a flag is set signaling the serializer to skip serialization of the body.