ReviewOS

home-lang/home

Bun parity: validate WebSocket upgrade accept headers

#391
Closed chris opened this 9 days ago ·
9 days ago

Parent: #66 Predecessor: #390

Corpus position 4203/4708: js/web/websocket/websocket-accept-header-validation.test.ts.

Home must validate the RFC 6455 Sec-WebSocket-Accept response before opening the client, preserve partial handshake reads, and expose actionable structured failures rather than generic connection strings.

Acceptance criteria:

  • unchanged upstream file passes 2/2
  • no failed, todo, unsupported, or allowed-empty classification
  • invalid or missing accept values dispatch the original Error through ErrorEvent
  • failures retain code, operation, phase, expected/actual accept values, status line, cause, and composed stack context
  • permanent regression covers both valid and invalid handshakes

Implementation: d0cbd31.

9 days ago

Completed and pushed in d0cbd31 (fix(websocket): validate upgrade accept headers).

The unchanged upstream validation file is 2/2 green with zero fallback classifications. Home validates the RFC 6455 accept value before opening, buffers partial responses and frames, carries the actual Error through ErrorEvent, and provides structured ERR_WEBSOCKET_HANDSHAKE diagnostics with operation, phase, details, cause, and composed stack context. The permanent regression passes.

Sign in to comment on this issue.