Skip to content

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

Open

Description

@theamodhshetty

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.

Activity

  1. added
    bugSomething is not working
    P1High: significant functionality gap or spec violation
    T-transportTransport layer changes
    ready for workIssue is well-defined and ready to be picked up
    on Oct 23, 2026
  2. github-actions commented on Oct 23, 2026

    @github-actions
    Contributor

    @DaleSeo (assignment failed) is on triage rotation this week and is the reviewer for this one.

    Codex labeled this bug / P1 (T-transport). Please confirm or correct those labels.

    Automated triage. Labels are a first pass and the assigned maintainer has the final say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High: significant functionality gap or spec violationT-transportTransport layer changesbugSomething is not workingready for workIssue is well-defined and ready to be picked up

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions