Skip to content

fix: use wildcard CORS origin for WHIP/WHEP endpoints#193

Merged
birme merged 1 commit intomainfrom
fix/whip-whep-cors-wildcard
Feb 26, 2026
Merged

fix: use wildcard CORS origin for WHIP/WHEP endpoints#193
birme merged 1 commit intomainfrom
fix/whip-whep-cors-wildcard

Conversation

@LucasMaupin
Copy link
Copy Markdown
Contributor

Summary

  • Simplify WHIP/WHEP CORS headers from origin reflection to Access-Control-Allow-Origin: *
  • These are open protocol endpoints authenticated by Bearer tokens (not cookies), so wildcard is safe and more standard
  • Remove the Origin header check — headers are now set unconditionally on all responses from these routes

Changed files

File Change
src/api_whip.ts Replace origin reflection with *, remove if (origin) guard
src/api_whep.ts Replace origin reflection with *, remove if (origin) guard

Test plan

  • yarn test passes (13 files, 205 tests)
  • Verify curl -v -X OPTIONS <url>/api/v1/whip/... returns Access-Control-Allow-Origin: *
  • Verify WHIP POST from OBS works with CORS headers
  • Verify global API routes are unaffected (scoped to plugin)

🤖 Generated with Claude Code

@LucasMaupin LucasMaupin requested a review from birme as a code owner February 26, 2026 13:22
Simplify CORS headers to use Access-Control-Allow-Origin: * instead of
reflecting the request Origin. These are open protocol endpoints
authenticated by Bearer tokens, not cookies, so wildcard is safe and
more standard.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@LucasMaupin LucasMaupin force-pushed the fix/whip-whep-cors-wildcard branch from e6ac741 to bf37d36 Compare February 26, 2026 13:24
@birme birme merged commit d0b391a into main Feb 26, 2026
4 checks passed
@LucasMaupin LucasMaupin deleted the fix/whip-whep-cors-wildcard branch February 27, 2026 11:08
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