Repository navigation
Ignore empty members of the Accept header - #610
Closed
dominikklein wants to merge 1 commit into
Closed
dominikklein wants to merge 1 commit into
dominikklein wants to merge 1 commit into
Conversation
An empty list member made parse_accept_header call strip on nil, so the transport answered 500. RFC 9110 asks recipients to ignore them. Fixes modelcontextprotocol#609.
Member
|
Closing in favor of #616, which skips empty members the same way and also covers the GET path, where the same header did not answer 500 but raised out of the transport, since #616 also adds a regression test for that GET case next to the POST ones, with the doubled and the leading comma checked separately. Thank you for the report and the RFC 9110 reference in #609. |
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.
An empty member in the
Acceptheader (application/json,,text/event-streamor, application/json, text/event-stream) madeparse_accept_headercallstriponnil, and the transport answered 500 with Internal server error. Empty members are now skipped, as RFC 9110 asks ("a recipient MUST parse and ignore a reasonable number of empty list elements", section 5.6.1.2), so such a request is checked like any other. A transport test covers a header with both kinds.Fixes #609.