Repository navigation
fix(runtime): respect identity and wildcard Accept-Encoding preferences - #5189
Closed
MilindChatrabhuji wants to merge 1 commit into
Closed
MilindChatrabhuji wants to merge 1 commit into
MilindChatrabhuji wants to merge 1 commit into
Conversation
|
@MilindChatrabhuji is attempting to deploy a commit to the Nitro Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Contributor
Author
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.
🔗 Linked issue
Resolves #5158
❓ Type of change
📚 Description
Updates static asset
Accept-Encodingnegotiation insrc/runtime/internal/static.tsto follow RFC 9110 §12.5.3 foridentityand wildcard (*) preferences:identityand wildcard (*) weights inparseAcceptEncodingalongside named encodings (EncodingMap), preserving explicitq=0exclusions (includingidentity;q=0and*;q=0).identitywhenidentityis not explicitly specified), while explicit weights take precedence over*.identityas the lowest-preference fallback when neitheridentitynor*appears inAccept-Encoding, and breaks equal-weight ties in favor of compressed codings ahead ofidentity.406(withCache-Control: no-storeandVary: Accept-Encodingwhen compressed variants exist) instead of404/ falling through whenhasAsset(id)is true andidentity("") was excluded alongside any other available representations.Local verification (Windows 11, Node v22.14.0)
oxfmt --check src/runtime/internal/static.ts test/unit/static-middleware.test.ts— passed.oxlint .— 0 errors (2 pre-existing triple-slash warnings inlib/vite.types.d.mtsandlib/rsbuild.types.d.mts).tsc --noEmit --skipLibCheck(afterobuild --stub,scripts/gen-presets.ts, andobuild) — passed.vitest run test/unit/static-middleware.test.ts test/unit/compress-assets.test.ts test/unit/preset-public-asset-cors.test.ts test/unit/assets-resolver.test.ts— 4 files, 75 tests passed (including 7 new negotiation &406/404regression cases).vitest run test/minimal— 1 file, 24 tests passed.📝 Checklist