diff --git a/v3/crates/engine/bin/engine/cors.rs b/v3/crates/engine/bin/engine/cors.rs index ba117b5a6d4..993ec49a20a 100644 --- a/v3/crates/engine/bin/engine/cors.rs +++ b/v3/crates/engine/bin/engine/cors.rs @@ -1,3 +1,4 @@ +use axum::http::header::HeaderName; use reqwest::Method; use std::time::Duration; use tower_http::cors; @@ -18,13 +19,15 @@ pub fn build_cors_layer(cors_allow_origin: &[String]) -> cors::CorsLayer { }) }) }; - + // Allow traceresponse to be retrievable on CORS + let trace_response_header_name = HeaderName::from_static("traceresponse"); cors::CorsLayer::new() .max_age(Duration::from_secs(24 * 60 * 60)) // 24 hours .allow_headers(cors::AllowHeaders::mirror_request()) .allow_origin(cors_allow_origin) .allow_credentials(true) .allow_methods(vec![Method::GET, Method::POST, Method::OPTIONS]) + .expose_headers([trace_response_header_name]) } #[cfg(test)]