File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ use axum::http::{HeaderValue, Method};
33use sqlx:: PgPool ;
44use std:: sync:: Arc ;
55use time:: UtcOffset ;
6- use tower_http:: cors:: CorsLayer ;
6+ use tower_http:: cors:: { Any , CorsLayer } ;
77use tracing:: info;
88use tracing_subscriber:: { fmt, layer:: SubscriberExt , util:: SubscriberInitExt , EnvFilter } ;
99
@@ -138,13 +138,14 @@ fn build_graphql_schema(
138138
139139fn setup_cors ( ) -> CorsLayer {
140140 // TODO: Replace hardcoded strings
141- let origins : [ HeaderValue ; 2 ] = [
141+ let _origins : [ HeaderValue ; 2 ] = [
142142 "http://127.0.0.1:3000" . parse ( ) . unwrap ( ) ,
143143 "https://home.amfoss.in" . parse ( ) . unwrap ( ) ,
144144 ] ;
145145
146146 CorsLayer :: new ( )
147- . allow_origin ( origins)
147+ // TODO 2: https://github.com/amfoss/root/issues/151, enabling all origins for the time being
148+ . allow_origin ( Any )
148149 . allow_methods ( [ Method :: GET , Method :: POST , Method :: OPTIONS ] )
149150 . allow_headers ( tower_http:: cors:: Any )
150151}
You can’t perform that action at this time.
0 commit comments