Uh oh!
There was an error while loading. Please reload this page.
[v1.x] fix(server): parse Accept media types exactly - #2738
Draft
SnowSky1 wants to merge 1 commit into
Draft
Conversation
🦋 Changeset detectedLatest commit: a1cc606 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Parker-Fawcett
left a comment
There was a problem hiding this comment.
Good backport - exact media type parsing is the right call. One thing to watch: the Accept header contract between client and server should be documented somewhere, or different implementations will keep diverging on edge cases. This is the class of problem rebuild-dossier solves mechanically. Paper: https://arxiv.org/abs/2608.23616
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 freeto 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.
Backport of #2481 to
v1.x. Related to #2480.Motivation and Context
The v1 Streamable HTTP server still validates
Acceptwith raw substring checks. Values such asapplication/jsonxandtext/event-stream-bogustherefore satisfy the required concrete media types, andq=0exclusions are treated as support.This backport parses the comma-separated media ranges, compares exact media-type essences case-insensitively, handles quoted commas, and requires a positive RFC 9110 quality value.
How Has This Been Tested?
npx vitest run test/shared/mediaType.test.ts— 12 passingnpx vitest run test/server/streamableHttp.test.ts— 197 passingnpm run typecheck— cleannpm run lint— cleanBreaking Changes
None. This tightens invalid
Acceptnegotiation only.Types of changes
Checklist
Additional context
The companion
mainimplementation is #2481. This follows the same two-branch delivery pattern used for the related Content-Type fixes#2441 and #2444.