@@ -299,7 +299,7 @@ std::shared_ptr<WhipInterceptor> WhipServer::CreateInterceptor()
299
299
response->SetStatusCode (http::StatusCode::NotFound);
300
300
return http::svr::NextHandler::DoNotCall;
301
301
}
302
-
302
+
303
303
if (_cors_manager.SetupHttpCorsHeader (vhost_app_name, request, response, {http::Method::Options, http::Method::Post, http::Method::Patch, http::Method::Delete}) == false )
304
304
{
305
305
// CORS from default cors manager from virtual host
@@ -380,7 +380,11 @@ std::shared_ptr<WhipInterceptor> WhipServer::CreateInterceptor()
380
380
}
381
381
382
382
// Set CORS header in response
383
- _cors_manager.SetupHttpCorsHeader (vhost_app_name, request, response);
383
+ _cors_manager.SetupHttpCorsHeader (vhost_app_name, request, response, {http::Method::Post});
384
+
385
+ // Access-Control-Expose-Headers header allows a server
386
+ // to indicate which response headers should be made available to scripts running in the browser in response to a cross-origin request.
387
+ response->AddHeader (" Access-Control-Expose-Headers" , " Location, Link, ETag" );
384
388
385
389
// Set SDP
386
390
response->SetHeader (" Content-Type" , " application/sdp" );
@@ -511,12 +515,12 @@ std::shared_ptr<WhipInterceptor> WhipServer::CreateInterceptor()
511
515
// TODO(way) : If url is changed by Webhooks, we use the changed url in PATCH request like delete request.
512
516
513
517
// Set CORS header in response
514
- _cors_manager.SetupHttpCorsHeader (vhost_app_name, request, response);
518
+ _cors_manager.SetupHttpCorsHeader (vhost_app_name, request, response, {http::Method::Patch} );
515
519
516
- auto session_id = request_url->GetQueryValue ( " session " );
520
+ auto session_id = request_url->File ( );
517
521
if (session_id.IsEmpty ())
518
522
{
519
- logte (" Could not get session id from query string " );
523
+ logte (" Could not get session id from url " );
520
524
response->SetStatusCode (http::StatusCode::BadRequest);
521
525
return http::svr::NextHandler::DoNotCall;
522
526
}
0 commit comments