Skip to content

Include the Vary header field in a 304 response for a precompressed resource - #1163

Open
arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:default-servlet-304-vary
Open

arturobernalg wants to merge 1 commit into
apache:mainfrom
arturobernalg:default-servlet-304-vary

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

RFC 9110 section 15.4.5 requires a 304 response to include the Vary header field that would have been sent in a 200 response to the same request.

When precompressed resources are available, DefaultServlet adds Vary: accept-encoding to the response, but only after it has checked the If headers. A 304 response for If-None-Match or If-Modified-Since was therefore sent without it, although the 200 response has it.

The header is now added before the If headers are checked. The list of precompressed resources is only looked up once.

The new test fails without the change and passes with it. TestDefaultServlet, TestDefaultServletRfc9110Section13, TestDefaultServletIfMatchRequests and TestDefaultServletRangeRequests pass.

…esource

RFC 9110 requires a 304 response to include the Vary header field that would have
been included in a 200 response to the same request. When precompressed
resources were available the DefaultServlet added Vary: accept-encoding after the
If headers had been checked so a 304 response did not include it.
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