Fix cors
This commit is contained in:
+5
-2
@@ -16,7 +16,7 @@ mod web;
|
||||
use anyhow::Result;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
use tower_http::cors::{AllowOrigin, CorsLayer};
|
||||
use tower_http::cors::{AllowOrigin, CorsLayer, Any};
|
||||
|
||||
use crate::api::Api;
|
||||
use crate::billing::Billing;
|
||||
@@ -52,7 +52,10 @@ async fn main() -> Result<()> {
|
||||
.iter()
|
||||
.filter_map(|o| o.parse::<axum::http::HeaderValue>().ok())
|
||||
.collect::<Vec<_>>();
|
||||
let cors = CorsLayer::new().allow_origin(AllowOrigin::list(parsed));
|
||||
let cors = CorsLayer::new()
|
||||
.allow_origin(AllowOrigin::list(parsed))
|
||||
.allow_methods(Any)
|
||||
.allow_headers(Any);
|
||||
|
||||
let app = api.router().layer(cors);
|
||||
|
||||
|
||||
@@ -11,10 +11,7 @@ pub struct Wallet {
|
||||
|
||||
impl Wallet {
|
||||
pub fn from_url(url: &str) -> Result<Self> {
|
||||
let url = url
|
||||
.parse::<NostrWalletConnectURI>()
|
||||
.map_err(|_| anyhow!("invalid NWC URL"))?;
|
||||
Ok(Self { url })
|
||||
Ok(Self { url: url.parse::<NostrWalletConnectURI>()? })
|
||||
}
|
||||
|
||||
pub async fn make_invoice(
|
||||
|
||||
Reference in New Issue
Block a user