Repository navigation
Answer a HEAD request with a 304 like the GET request (#1738) - #1741
Merged
Merged
Conversation
RFC 9110 sections 9.3.2 and 15.4.5: a 304 carries the validators and caching headers only. The HEAD branch came first and wrote all the entity headers (Content-Type, Last-Modified...) on a HEAD answered 304. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 28, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Fixes #1738.
RFC 9110 §9.3.2 and §15.4.5: a HEAD request answered 304 is answered like the GET, with the validators and caching headers only (the server SHOULD NOT send other representation metadata). The server adapters tested the method
HEADbefore the status 304, so a HEAD answered 304 wrote all the entity headers (Content-Type,Last-Modified, ...) instead of the restricted set a GET 304 carries (NettyServerCall.prepareEntityin 3.0,ServerAdapter.commitin 2.7 and 2.6).The 304 status is now tested first; the other statuses keep their path (the branches are exclusive on the status). No API change.
Tests: three added to the wire-level
NotModifiedHeadersTestCase(HEAD 304 withoutContent-Type/Last-Modified, same header names as the GET 304, unconditional HEAD unchanged).changes.mdupdated.Same fix on the other maintained versions: 3.0: #1739, 2.7: #1740
🤖 Generated with Claude Code