ReviewOS

home-lang/home

Preserve Unicode WebSocket upgrade inputs and peer teardown

#409
Closed chris opened this 10 days ago ·
10 days ago

Parent: #66

Port Bun corpus position 4221 (js/web/websocket/websocket-utf16-headers.test.ts).

Scope:

  • encode Latin-1/high-byte header values as UTF-8 on the wire
  • preserve UTF-16 and non-ASCII URL paths without corruption
  • validate offered subprotocols as unique HTTP tokens before transport setup
  • propagate accepted node:net peer destruction to WebSocket EOF/close
  • cover proxy, TLS, custom proxy headers, and high header counts
  • provide structured invalid-offer diagnostics (ERR_WEBSOCKET_PROTOCOL, operation, phase, protocol/index, cause, source-aware stack)

Acceptance: 7 passed, 0 todo, 0 failed, 0 unsupported, 0 allowed-empty.

Implementation: 22f7e16

10 days ago

Implemented on main in 22f7e16.

Verified the exact Bun corpus file: 7 passed, 0 todo, 0 failed, 0 unsupported, 0 allowed-empty. The permanent gates include the exact upstream file and a structured invalid-subprotocol regression covering code, operation, phase, protocol/index, cause, and source-aware stack.

Sign in to comment on this issue.