Skip to content

fix(ws): percent-encode sign-server route params in the WebSocket URI - #377

Merged
isaackogan merged 1 commit into
masterfrom
fix/encode-fallback-route-params
Sep 10, 2026
Merged

isaackogan merged 1 commit into
masterfrom
fix/encode-fallback-route-params

Conversation

@isaackogan

Copy link
Copy Markdown
Owner

Summary

Euler Stream now routes connections through its fallback push server (wss://ws-fallback.eulerstream.com/) and echoes the raw user_agent back as a route param. build_webcast_uri joined route params verbatim, so the handshake request-target contained literal spaces and parentheses and the server answered 400 Bad Request with an empty body.

  • Percent-encode route param values only. Base params keep their pre-encoded preset values (browser_version) and are not double-encoded.
  • Regression tests for both in tests/test_ws_utils.py.
  • Fold the 400 handshake case into WebcastBlockedError; keep WebcastBlocked200Error as a backwards-compatible alias.

Verification

  • Against the live fallback server with the same signed token: current URL -> 400; route params encoded -> 101 Switching Protocols.
  • Full client run: ConnectEvent, room entered, ping loop, comment and like events received.
  • pytest 17 passed, mypy clean on the lint workflow's module list.

https://claude.ai/code/session_01GZ9hdAnN45CPpd5jZBArcW

Euler Stream now routes connections through its fallback push server
(wss://ws-fallback.eulerstream.com/) and echoes the raw user agent back
as a route param. The URI builder joined route params verbatim, so the
handshake request-target contained literal spaces and parentheses and
the server answered 400 Bad Request with an empty body.

Encode route param values only; base params keep their pre-encoded
preset values (browser_version) and are not double-encoded. Adds a
regression test for both.

Also fold the 400 handshake case into WebcastBlockedError and keep
WebcastBlocked200Error as a backwards-compatible alias.

Claude-Session: https://claude.ai/code/session_01GZ9hdAnN45CPpd5jZBArcW
@isaackogan
isaackogan merged commit be3dceb into master Sep 10, 2026
4 checks passed

This branch was previously deployed

1 inactive deployment
github-pages — be3dceb3 Deployed Sep 10, 2026 by isaackogan via deploy #16
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