Skip to content
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
8 changes: 7 additions & 1 deletion crates/breez-sdk/lnurl/src/auth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use axum::{
extract::{self, Request},
http::{StatusCode, header::AUTHORIZATION},
http::{Method, StatusCode, header::AUTHORIZATION},
middleware::Next,
response::Response,
};
Expand All @@ -18,6 +18,12 @@ pub async fn auth<DB>(
where
DB: Send + Sync + 'static,
{
// CORS preflight requests don't carry credentials; let them through
// so the CorsLayer can add the appropriate response headers.
if req.method() == Method::OPTIONS {
return Ok(next.run(req).await);
}

let Some(ca_cert) = state.ca_cert.as_ref() else {
return Ok(next.run(req).await);
};
Expand Down
Loading