Skip to content

Commit 3a62a6b

Browse files
committed
allow any CORS origin for Chromecast HLS playback
Auth is token/session-based (not cookies), so wildcard origin is safe. Chromecast HLS player fetches playlist and segments via XHR which requires CORS from Google's receiver domain.
1 parent 543f3e4 commit 3a62a6b

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/main.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,8 @@ async fn app() -> Result<Router> {
189189
let plugin_manager = PluginManager::new().await?;
190190
let mut mc = ModelController::new(store, plugin_manager).await?;
191191

192-
let origins = [
193-
"http://localhost:3000".parse().unwrap(),
194-
"https://www.redseat.cloud".parse().unwrap(),
195-
];
196-
197192
let cors: CorsLayer = CorsLayer::new()
198193
.max_age(Duration::from_secs(3600))
199-
// allow `GET` and `POST` when accessing the resource
200194
.allow_methods(vec![
201195
Method::GET,
202196
Method::PATCH,
@@ -213,7 +207,9 @@ async fn app() -> Result<Router> {
213207
REFERRER_POLICY,
214208
REFERER,
215209
])
216-
.allow_origin(origins)
210+
// Allow any origin: auth is token/session-based (not cookies),
211+
// and Chromecast HLS playback requires CORS from Google's receiver domain
212+
.allow_origin(Any)
217213
.allow_credentials(true);
218214

219215
let server_id = get_server_id().await;

0 commit comments

Comments
 (0)