Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
cors: enable allow_credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
xvello committed Nov 3, 2023
1 parent 4b3634b commit 4384933
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions capture/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use axum::{
routing::{get, post},
Router,
};
use tower_http::cors::{AllowOrigin, Any, CorsLayer};
use tower_http::cors::{AllowHeaders, AllowOrigin, CorsLayer};
use tower_http::trace::TraceLayer;

use crate::{billing_limits::BillingLimiter, capture, redis::Client, sink, time::TimeSource};
Expand Down Expand Up @@ -47,7 +47,8 @@ pub fn router<
// and reverse proxies might send funky headers.
let cors = CorsLayer::new()
.allow_methods([Method::GET, Method::POST, Method::OPTIONS])
.allow_headers(Any)
.allow_headers(AllowHeaders::mirror_request())
.allow_credentials(true)
.allow_origin(AllowOrigin::mirror_request());

let router = Router::new()
Expand Down

0 comments on commit 4384933

Please sign in to comment.