reqwest Streamable HTTP client matches response Content-Type by case-sensitive prefix

Aperta
#1,389 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@DaleSeo ci sta già lavorando.

Dal 23/10/2026.

  • #1390 di @theamodhshetty — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug P1 ready for work T-transport

Problem

The reqwest Streamable HTTP client checks response Content-Type using case-sensitive byte prefixes. This is the client-response counterpart of #1381; #1382 changes server request validation only.

On upstream 2a401c4, a local axum listener returning valid JSON-RPC or SSE payloads shows:

  • POST Application/JSON and Text/Event-Stream are rejected, although media types are case-insensitive.
  • POST application/jsonx, application/json-seq and text/event-streaming are admitted as JSON/SSE rather than rejected as different types.
  • GET has the same case/prefix issue, including admitting comma-joined Content-Type values.
  • A POST 503 carrying Application/JSON and a valid JSON-RPC error returns opaque HTTP metadata rather than preserving that error. The newly merged 429 body-free behavior is unaffected.

RFC 9110 section 8.3.1 defines case-insensitive type/subtype names; parameters do not change the media-type essence.

Reproduction and proposed scope

I added 22 source-module tests using real axum listeners and the reqwest StreamableHttpClient methods: 12 fail on unchanged upstream, while 10 controls pass. They exercise GET, POST JSON/SSE, parameters, absent headers, suffix/list rejection and HTTP error classification.

A narrow fix can share a private exact, ASCII-case-insensitive essence matcher across the existing reqwest GET admission, POST response dispatch and JSON error classification. It would preserve the current accepted media types, parameter tolerance and 429 policy, with no dependency or API changes. The Unix-socket backend is outside this reqwest-specific proposal.

Opening this discussion before a draft implementation PR, per CONTRIBUTING. Feedback on this scope is welcome; no maintainer approval is assumed. Investigation and tests used Codex assistance.

Lingua principale
Rust
Stelle
4.1k
Fork
694
Merge medio
3g 14h
PR unite (30g)
39

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/rust-sdk

Tutte le issue di modelcontextprotocol/rust-sdk

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.