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

Aberta
#1,389 2 comentários 0 reações 1 responsável Ver no GitHub

Mantenedores costumam responder em até 2 dias

@DaleSeo já está trabalhando nisso.

Desde 23/10/2026.

  • #1390 de @theamodhshetty — aberto

Avaliação

Esta issue ainda não foi avaliada.

Descrição

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.

Linguagem predominante
Rust
Estrelas
4.1k
Forks
694
Merge médio
3d 14h
PRs com merge (30d)
39

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de modelcontextprotocol/rust-sdk

Todas as issues de modelcontextprotocol/rust-sdk

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.