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

cors: enable allow_credentials #44

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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