Implement RFC 9111 compliant quoted-string parsing for Cache-Control directives#3986
Merged
gaby merged 2 commits intoupdate-cache-handling-for-authenticationfrom Jan 4, 2026
Merged
Conversation
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the Comment |
…directives Co-authored-by: gaby <835733+gaby@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## update-cache-handling-for-authentication #3986 +/- ##
============================================================================
+ Coverage 90.87% 90.96% +0.09%
============================================================================
Files 119 119
Lines 10758 10782 +24
============================================================================
+ Hits 9776 9808 +32
+ Misses 623 617 -6
+ Partials 359 357 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Copilot
AI
changed the title
[WIP] Fix cache middleware compliance for quoted-string values
Implement RFC 9111 compliant quoted-string parsing for Cache-Control directives
Jan 4, 2026
8862fae
into
update-cache-handling-for-authentication
17 checks passed
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.
Description
The
parseCacheControlDirectivesfunction did not handle quoted-string values per RFC 9111 Section 5.2 / RFC 9110 Section 5.6.4. Directives likecommunity="UCI"were parsed with quotes included in the value ("UCI"instead ofUCI). While current directives (max-age,s-maxage, etc.) use token values, proper quoted-string support ensures RFC compliance and future-proofs the parser.Changes introduced
Implementation:
parseCacheControlDirectivesto detect and unquote quoted-string directive valuesunquoteCacheDirectivehelper that removes surrounding quotes and processes backslash-escapes=delimiterTesting:
Test_parseCacheControlDirectives_QuotedStrings: 10 test cases covering quoted values, mixed directives, escaped charactersTest_unquoteCacheDirective: 9 test cases for unquoting logic including edge casesExamples:
Type of change
Checklist
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.