Repository navigation
Harden Response/Output cache - #68517
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the cache key serialization used by Response Caching and Output Caching by making the (PathBase, Path) portion of the key injective, preventing distinct tuples from producing identical cache keys.
Changes:
- Insert the existing reserved
KeyDelimiter(\x1e) betweenHttpRequest.PathBaseandHttpRequest.Pathin both key providers (case-sensitive and case-insensitive modes). - Update existing key-provider tests to reflect the new delimiter placement.
- Add new tests asserting non-collision for a previously ambiguous
(PathBase, Path)concatenation scenario.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/Middleware/ResponseCaching/src/ResponseCachingKeyProvider.cs | Inserts KeyDelimiter between PathBase and Path when building the base key. |
| src/Middleware/ResponseCaching/test/ResponseCachingKeyProviderTests.cs | Updates expected base-key strings and adds an injectivity test. |
| src/Middleware/OutputCaching/src/OutputCacheKeyProvider.cs | Inserts KeyDelimiter between PathBase and Path when building the base key. |
| src/Middleware/OutputCaching/test/OutputCacheKeyProviderTests.cs | Updates expected storage-key strings and adds an injectivity test. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
DeagleGross
approved these changes
Aug 14, 2026
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
DeagleGross
approved these changes
Aug 14, 2026
cincuranet
approved these changes
Aug 14, 2026
This was referenced Aug 16, 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 #67907
This separates path base and path via key delimiter