Skip to content

Do not send response bodies for HEAD requests - #165

Open
Willenbrink wants to merge 1 commit into
anmonteiro:masterfrom
Willenbrink:suppress-head-response-body
Open

Willenbrink wants to merge 1 commit into
anmonteiro:masterfrom
Willenbrink:suppress-head-response-body

Conversation

@Willenbrink

Copy link
Copy Markdown

HEAD requests should not receive any content in their response. See https://www.rfc-editor.org/info/rfc9110/#section-9.3.2.

This PR suppresses response body writes when the request method is HEAD, while retaining the response headers that describe the GET representation. Streaming responses receive a discard writer so application writes and flushes continue to work without emitting bytes.

Created with AI assistance as I'm not familiar with this library.

Suppress response body writes when the request method is HEAD, while retaining
the response headers that describe the GET representation. Streaming responses
receive a discard writer so application writes and flushes continue to work
without emitting bytes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant