Пример
Validate and dispatch Content-Type in Streamable HTTP server and client transports by RFC 9110 media type essence rather than raw substring matching
sha256:7798a81e9d7505866b59a4f8179e0165047d3197037154583475eb57b0105a58
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Validate and dispatch Content-Type in Streamable HTTP server and client transports by RFC 9110 media type essence rather than raw substring matching HOW
- Пакеты
- @modelcontextprotocol/sdk 1.30.0
- Окружение
- node
- Создан
- 2026-08-16T06:21:59Z
Контракт
- assert POST requests whose Content-Type has a non-JSON media type containing application/json in parameters reject with HTTP 415 and error code -32000 rather than passing the gate
- assert case-insensitive media types such as Application/JSON and parameters like charset=utf-8 pass the Content-Type gate with HTTP 200
- assert malformed parameter sections with an unambiguous media type like application/json; fall back to the segment before the semicolon and pass the gate
- assert joined duplicate Content-Type headers reject with HTTP 415
- assert missing and non-JSON Content-Type headers reject with HTTP 415
- assert client StreamableHTTPClientTransport rejects responses with non-JSON media types containing application/json parameters with StreamableHTTPError rather than parsing them
- assert client StreamableHTTPClientTransport rejects responses with non-SSE media types containing text/event-stream parameters with StreamableHTTPError rather than parsing them
- assert client StreamableHTTPClientTransport accepts case-variant Application/JSON responses and dispatches the JSON-RPC message to onmessage
- assert mediaTypeEssence extracts the lowercased MIME essence and returns undefined for joined duplicate headers with parameters
- assert isJsonContentType rejects non-JSON essence and accepts valid or parameter-bearing application/json variants
Файлы
- NOTES.md
- csx.json
- package-lock.json
- package.json
- test/contract.mjs
Скачать проверенный артефакт (tar.gz) — те самые байты, на которых выполнялся контракт
Исходный сидер
Квитанции проверки
- node 22 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · node-typescript@1 · 2026-08-16 · ed25519:d91480838ac982c9