| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@felixweinberger @maxisbey could you please review this when you get a chance? Thanks! |
Sorry, something went wrong.
|
Bumping this — just rebased onto latest main (clean, no conflicts). This fixes a real interoperability bug: clients like httpx and requests send Accept: */* by default and currently get a 406 Not Acceptable. All CI is passing. If anyone's on the MCP Discord, would really appreciate a ping to get eyes on this. Happy to make any changes to get it merged. 🙏 |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for this — the approach is correct and the test coverage is great. Two small asks before merge (suggestions inline, should be one-click applies).
Sorry, something went wrong.
The server rejected requests with wildcard Accept headers like `*/*`, `application/*`, or `text/*`, returning 406 Not Acceptable. This violated RFC 7231, section 5.3.2, which defines wildcard media ranges as valid. Update `_check_accept_headers` to recognize `*/*` as matching all types, `application/*` as matching `application/json`, and `text/*` as matching `text/event-stream`. Also strip quality parameters before matching. Github-Issue:modelcontextprotocol#1641 Reported-by:rh-fr
- Normalize media types to lowercase for case-insensitive matching per RFC 7231 - Use exact match instead of startswith to prevent over-matching - Replace headers.update with headers.pop for cleaner Accept removal in tests
|
Thanks for the thorough review @maxisbey! Applied all your suggestions:
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Problem
The server rejected requests with wildcard Accept headers like */* or application/*, returning 406 Not Acceptable. This violated RFC 7231 and broke interoperability with HTTP clients that send Accept: */* by default (e.g. httpx, requests).
Closes #1641
Test plan