Skip to content

Pin the handshake edges: userinfo, redirects, transport size caps - #15

Merged
lann merged 1 commit into
mainfrom
handshake-edges
Aug 4, 2026
Merged

lann merged 1 commit into
mainfrom
handshake-edges

Conversation

@lann

@lann lann commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

The three actionable items from the RFC 6455/WHATWG feature sweep:

  1. Userinfo rejection (browser floor: WHATWG throws on URL credentials): both eager validators now fail invalid-url; WIT docs updated; the connect-invalid-url case fails against both previous hosts (stash-verified — jco had the wrong taxonomy, native would have connected).
  2. Redirects pinned: /redirect fault mode (302 → a working /echo, so following would expose itself) + connect-redirect row asserting connect-failed on every target.
  3. Transport size caps scale with the ctx bound: tungstenite's fixed 64 MiB/16 MiB defaults no longer diverge from the browser path when an embedder raises max_inbound_buffer_bytes; capacity errors past the cap latch the overflow taxonomy instead of reporting an abnormal close. Untestable at suite scale (>64 MiB flood) — mapping documented in the pump.

52×3 green, just ci green.

Three gaps from the spec sweep, each a place the hosts could diverge
from the browser floor (or from each other) with nothing gating it.

Userinfo in connect URLs was not rejected: the WHATWG constructor
throws on credentials, so the jco host failed such URLs with the wrong
taxonomy (connect-failed, from the constructor throw) while the native
host would have connected. Both eager validators now fail invalid-url,
the WIT invalid-url/connect docs name userinfo alongside fragments, and
connect-invalid-url carries the case - it fails against both previous
hosts (stash-verified).

Handshake redirects were unpinned: browsers never follow them and
tungstenite does not either, but no row asserted the shared behavior.
A /redirect fault mode (302 toward a working /echo, so a client that
followed would connect and expose itself) and a connect-redirect row
pin connect-failed on every target.

The native transport's size caps were tungstenite's fixed defaults
(64 MiB message / 16 MiB frame), invisible today only because the
8 MiB buffer bound overflows first: an embedder raising the bound past
the caps would get transport protocol errors (abnormal close) where a
browser-backed host delivers the message into the budget's
overflow-close path. The caps now scale with the configured bound, and
a capacity error past them latches the same overflow taxonomy
(backlog, then receive-buffer-overflow) instead of masquerading as an
abnormal closure - the mid-frame read stream is torn down after the
close frame is offered. That mapping is documented rather than
conformance-gated: exercising it would need a >64 MiB flood.
@lann
lann merged commit 444640f into main Aug 4, 2026
2 checks passed
@lann
lann deleted the handshake-edges branch August 4, 2026 16:10
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.

2 participants