Skip to content

Answer a HEAD request with a 304 like the GET request (#1738) - #1741

Merged
thboileau-git merged 1 commit into
2.6from
fix/1738-head-not-modified-headers-2.6
Nov 28, 2026
Merged

thboileau-git merged 1 commit into
2.6from
fix/1738-head-not-modified-headers-2.6

Conversation

@thboileau-git

@thboileau-git thboileau-git commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

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 HEAD before 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.prepareEntity in 3.0, ServerAdapter.commit in 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 without Content-Type / Last-Modified, same header names as the GET 304, unconditional HEAD unchanged). changes.md updated.

Same fix on the other maintained versions: 3.0: #1739, 2.7: #1740

🤖 Generated with Claude Code

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]>
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@thboileau-git
thboileau-git merged commit 470f979 into 2.6 Nov 28, 2026
2 of 3 checks passed
@thboileau-git
thboileau-git deleted the fix/1738-head-not-modified-headers-2.6 branch November 28, 2026 12:46
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