From 52d82eed80ef120df3bb925531ce08dacafc0ef5 Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Fri, 5 May 2023 09:32:21 +0300 Subject: [PATCH] feat: allow all cors --- src/handler.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/handler.rs b/src/handler.rs index ce979ee..4df1044 100644 --- a/src/handler.rs +++ b/src/handler.rs @@ -21,7 +21,7 @@ use base64::Engine; use futures::{SinkExt, StreamExt}; use http::{ header::{AUTHORIZATION, CONTENT_TYPE}, - HeaderValue, Method, Request, Response, StatusCode, + Method, Request, Response, StatusCode, }; use hyper::Body; use serde::{Deserialize, Serialize}; @@ -32,7 +32,7 @@ use tower_http::{ }; use tracing::{Instrument, Span}; -use crate::{get_conf, AppState, B64}; +use crate::{AppState, B64}; #[derive(Deserialize)] struct Auth { @@ -144,7 +144,7 @@ pub(super) async fn handler(state: AppState) -> Result { .layer(trace_layer) .layer( CorsLayer::new() - .allow_origin(get_conf("CORS_ALLOW_ORIGIN")?.parse::()?) + .allow_origin(tower_http::cors::Any) .allow_headers([CONTENT_TYPE]) .allow_methods([Method::GET]), );