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

未关闭
#1,389 2 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 2 天内回复

@DaleSeo 已经在做这个了。

开始于 2026年10月23日。

  • #1390 来自 @theamodhshetty —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

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.

主要语言
Rust
星标
4.1k
派生
694
平均合并
3 天 14 小时
30 天内合并 PR
39

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

modelcontextprotocol/rust-sdk 的其他 Issue

查看 modelcontextprotocol/rust-sdk 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。