watchparty/server
Nicolas c00585101b
All checks were successful
Publier l'image Docker / test (push) Successful in 20s
Publier l'image Docker / publish (push) Successful in 12s
Add CORS to the streaming routes - the real reason cast never played
Reported again after the castToken-propagation fix: "still doesn't
work, the stream doesn't play on the TV side." That fix was real, but
addressed what would break after the first segment - this was more
fundamental, blocking things from the very first request.

The Default Media Receiver plays this app's HLS through an MSE-based
player (Chromecast's Chromium build has no native HLS support), which
fetches every segment via fetch/XHR from whatever origin Google hosts
the receiver at - cross-origin from this server. This app never sent a
single CORS header anywhere; every consumer until now was its own
same-origin page. Without one, the browser blocks every one of those
reads outright, before this app's own cookie/castToken check even runs
- the master playlist request itself included.

Fixed with a small allowCastCors middleware on the same 4 streaming
routes sessionForStream already covers - Access-Control-Allow-Origin:
*, plus handling OPTIONS for the same 4 paths (Range, needed for
segment fetches, isn't CORS-safelisted, so a real cross-origin request
carrying one triggers a preflight this app had no answer for at all).
`*` is safe here specifically because these routes never need
credentialed cross-origin access: a real browser already reaches them
same-origin, and the one genuine cross-origin caller authenticates via
the castToken query param, never a cookie.

Verified: full typecheck/test/build (122/122). Confirmed against the
real running server that an OPTIONS preflight now answers 204 with the
right headers, a real GET still carries Access-Control-Allow-Origin
regardless of outcome, and an unrelated route carries no such header -
scoped to exactly the 4 routes a Chromecast needs. Not verified:
whether this is sufficient for a real receiver to actually play the
stream end to end - no device reachable from this sandbox.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 20:27:51 +02:00
..
src Add CORS to the streaming routes - the real reason cast never played 2026-09-15 20:27:51 +02:00
test Fix casting past the first segment, and the toolbar's real auto-hide bug 2026-09-15 20:18:29 +02:00
.dockerignore Pivot to a standalone app - Emby plugin hit a hard wall 2026-09-13 20:48:55 +02:00
.env.example Pivot to a standalone app - Emby plugin hit a hard wall 2026-09-13 20:48:55 +02:00
Dockerfile Self-hosted ffmpeg pipeline for PGS (image) subtitle burn-in 2026-09-14 18:05:08 +02:00
package-lock.json Rewrite server + client in TypeScript, service-oriented server architecture 2026-09-14 09:38:14 +02:00
package.json Cast a party's video to a Chromecast 2026-09-15 10:13:12 +02:00
tsconfig.json Rewrite server + client in TypeScript, service-oriented server architecture 2026-09-14 09:38:14 +02:00
tsconfig.test.json Add a real server test suite and gate CI's Docker publish on it 2026-09-14 09:57:47 +02:00