Validate Content-Type by parsed media type instead of substring match (v1.x) (#2444)
This commit is contained in:
parent
369513df7b
commit
69749aa508
1 changed files with 271 additions and 4 deletions
6
.changeset/content-type-media-type-validation.md
Normal file
6
.changeset/content-type-media-type-validation.md
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
'@modelcontextprotocol/sdk': patch
|
||||
---
|
||||
|
||||
Validate `Content-Type` by its parsed media type instead of a substring match. POSTs to the Streamable HTTP server transport whose media type is not `application/json` are now rejected with `415 Unsupported Media Type` (previously any value containing the substring passed, and
|
||||
valid case variants were wrongly rejected). Values with parameters (`application/json; charset=utf-8`, including malformed parameter sections like `application/json;`) continue to work, and the client's response dispatch uses the same parsed comparison.
|
||||
Loading…
Reference in a new issue