Skip to content

Conversation

@bneradt
Copy link
Contributor

@bneradt bneradt commented Nov 17, 2025

According to RFC 7234 section 3.2, a shared cache can serve cached
responses to requests with Authorization headers if the response contains
one of the following Cache-Control directives: must-revalidate,
proxy-revalidate, public, or s-maxage. The implementation was missing the
check for s-maxage, causing requests with Authorization headers to always
bypass the cache even when s-maxage was present in the cached response.

This commit adds the missing check for s-maxage in the AuthenticationNeeded()
function and includes comprehensive tests to verify the fix and prevent
regression.

Fixes: #7227

@bneradt bneradt added this to the 10.2.0 milestone Nov 17, 2025
@bneradt bneradt added the Cache label Nov 17, 2025
@bneradt bneradt self-assigned this Nov 17, 2025
@bneradt bneradt added the Cache label Nov 17, 2025
@bneradt bneradt requested a review from ezelkow1 November 17, 2025 20:44
@bneradt bneradt force-pushed the fix_s_maxage_handling branch from 8b9ecaa to 25652ca Compare November 17, 2025 20:48
According to RFC 7234 section 3.2, a shared cache can serve cached
responses to requests with Authorization headers if the response contains
one of the following Cache-Control directives: must-revalidate,
proxy-revalidate, public, or s-maxage. The implementation was missing the
check for s-maxage, causing requests with Authorization headers to always
bypass the cache even when s-maxage was present in the cached response.

This commit adds the missing check for s-maxage in the AuthenticationNeeded()
function and includes comprehensive tests to verify the fix and prevent
regression.

Fixes apache#7227
@bneradt bneradt force-pushed the fix_s_maxage_handling branch from 25652ca to e5c50f5 Compare November 17, 2025 20:50
@bryancall bryancall added the Bug label Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

s-maxage not respected with authorization headers

2 participants