Skip to content

Ignore Content-Type parameters when polling MSC4108 rendezvous channel - #5404

Draft
krithin wants to merge 1 commit into
matrix-org:developfrom
krithin:fix/msc4108-rendezvous-content-type-params
Draft

Ignore Content-Type parameters when polling MSC4108 rendezvous channel#5404
krithin wants to merge 1 commit into
matrix-org:developfrom
krithin:fix/msc4108-rendezvous-content-type-params

Conversation

@krithin

@krithin krithin commented Jul 8, 2026

Copy link
Copy Markdown

MSC4108RendezvousSession.receive() compared the Content-Type header against "text/plain" with strict string equality. If a reverse proxy in front of the rendezvous server appends parameters to the header (e.g. nginx's charset directive rewrites it to text/plain; charset=utf-8), every incoming payload was treated as "no new message" and silently discarded, deadlocking QR code login until the session expired.

Parse out the media type per RFC 9110 (parameters follow the type/subtype after a semicolon; type names are case-insensitive) before comparing.

Checklist

  • Tests written for new code (and old code if feasible).
  • New or updated public/exported symbols have accurate TSDoc documentation.
  • Linter and other CI checks pass.
  • Sign-off given on the changes (see CONTRIBUTING.md).

@github-actions github-actions Bot added the Z-Community-PR Issue is solved by a community member's PR label Jul 8, 2026
MSC4108RendezvousSession.receive() compared the Content-Type header
against "text/plain" with strict string equality. If a reverse proxy in
front of the rendezvous server appends parameters to the header (e.g.
nginx's `charset` directive rewrites it to `text/plain; charset=utf-8`),
every incoming payload was treated as "no new message" and silently
discarded, deadlocking QR code login until the session expired.

Parse out the media type per RFC 9110 (parameters follow the type/subtype
after a semicolon; type names are case-insensitive) before comparing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Krithin Sitaram <1389679+krithin@users.noreply.github.com>
@krithin
krithin force-pushed the fix/msc4108-rendezvous-content-type-params branch from 43d5516 to 53ffe26 Compare July 8, 2026 07:08
@t3chguy

t3chguy commented Jul 8, 2026

Copy link
Copy Markdown
Member

Unfortunately the spec dictates text/plain and does not mention dealing with any parameters https://github.com/matrix-org/matrix-spec-proposals/blob/87f8317a902cd7bc5c2d2d225f71021b3a509e2d/proposals/4108-oidc-qr-login.md

This is the v2024 edition of MSC4108 which is the only variant currently supported. The v2025 (latest) edition of the MSC does not have this issue seemingly.

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

Labels

Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants