Skip to content

fix: validate the event stream MIME type - #366

Open
bensynapse wants to merge 1 commit into
EventSource:mainfrom
bensynapse:fix-content-type-essence
Open

bensynapse wants to merge 1 commit into
EventSource:mainfrom
bensynapse:fix-content-type-essence

Conversation

@bensynapse

Copy link
Copy Markdown

I run Live Tennis API.

The current prefix check rejects Text/Event-Stream and accepts text/event-streaming. This change compares the parsed MIME essence with text/event-stream, ignoring case and parameters.

Combined headers follow Fetch's MIME extraction.
The last valid MIME type wins. Invalid values and */* are ignored. Commas inside quoted parameters are preserved.

The shared HTTP suite adds 39 cases covering case, parameters, invalid subtypes, quoted commas and repeated headers. Sixteen of these fail against the original implementation. A patch changeset is included.

Validation:

  • Node 22, 24 and 26, Bun and Deno test suites.
  • Chromium, Firefox and WebKit browser suites.
  • happy-dom and workerd suites, including their existing expected failures.
  • Type compatibility, lint, formatting, build and package checks.

iOS tests were not run on this Linux host.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant