Title: fix: accept wildcard media types in Accept header per RFC 7231 by shivama205 · Pull Request #2152 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: fix: accept wildcard media types in Accept header per RFC 7231 by shivama205 · Pull Request #2152 · modelcontextprotocol/python-sdk
X Title: fix: accept wildcard media types in Accept header per RFC 7231 by shivama205 · Pull Request #2152 · modelcontextprotocol/python-sdk
Description: Summary Fix _check_accept_headers to accept wildcard media types (*/*, application/*, text/*) in the Accept header, per RFC 7231, section 5.3.2 Strip quality value parameters (e.g. ;q=0.8) before matching media types Add comprehensive tests for wildcard acceptance and rejection scenarios 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 Wildcard */* accepted for both SSE and JSON-only modes application/* + text/* accepted for SSE mode application/* alone correctly rejected for SSE mode (doesn't cover text/event-stream) Quality parameters (*/*;q=0.8) handled correctly Truly missing Accept header still rejected Incompatible types (text/html) still rejected All 1134 existing tests pass Linting, formatting, and type checks clean
Open Graph Description: Summary Fix _check_accept_headers to accept wildcard media types (*/*, application/*, text/*) in the Accept header, per RFC 7231, section 5.3.2 Strip quality value parameters (e.g. ;q=0.8) before ...
X Description: Summary Fix _check_accept_headers to accept wildcard media types (*/*, application/*, text/*) in the Accept header, per RFC 7231, section 5.3.2 Strip quality value parameters (e.g. ;q=0.8) before ...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2152
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:a9230662-24f1-1dfb-16a2-3cc8d530b66a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9F98:2EC9F3:7A7A45:A547F3:6A5A7D87 |
| html-safe-nonce | 8c410598bfe2e602cc8fe026528b052112d7ef35d79ac3a249a3c151b1efa4fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Rjk4OjJFQzlGMzo3QTdBNDU6QTU0N0YzOjZBNUE3RDg3IiwidmlzaXRvcl9pZCI6Ijc4NTU4MTI0ODk3NjIyMDkxNTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c62142f701ccaeaac036b93138dcfc2cb17b5a941407b14181709d8bbaad92b3 |
| hovercard-subject-tag | pull_request:3333961995 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2152/files |
| twitter:image | https://avatars.githubusercontent.com/u/7421625?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/7421625?s=400&v=4 |
| og:image:alt | Summary Fix _check_accept_headers to accept wildcard media types (*/*, application/*, text/*) in the Accept header, per RFC 7231, section 5.3.2 Strip quality value parameters (e.g. ;q=0.8) before ... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 922bdba685ea48400234d557977f0e32d9adbae6f5125725b4f48cacc6801106 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0437efb828a4041956ce45d1f7fe69fff38926c7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width