Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit b565249

Browse files
chanangejennaramdenee
authored andcommitted
fix: Include Authorization and Accept in CORs allowed headers
1 parent bad4efc commit b565249

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

martin/src/srv/server.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use actix_web::dev::Server;
77
use actix_web::error::{ErrorBadRequest, ErrorInternalServerError, ErrorNotFound};
88
use actix_web::http::header::{
99
AcceptEncoding, ContentType, Encoding as HeaderEnc, HeaderValue, Preference, CACHE_CONTROL,
10-
CONTENT_ENCODING,
10+
CONTENT_ENCODING, AUTHORIZATION, ACCEPT
1111
};
1212
use actix_web::http::Uri;
1313
use actix_web::middleware::TrailingSlash;
@@ -481,7 +481,8 @@ pub fn new_server(config: SrvConfig, state: ServerState) -> crate::Result<(Serve
481481
let server = HttpServer::new(move || {
482482
let cors_middleware = Cors::default()
483483
.allow_any_origin()
484-
.allowed_methods(vec!["GET"]);
484+
.allowed_methods(vec!["GET"])
485+
.allowed_headers(vec![AUTHORIZATION, ACCEPT]);
485486

486487
App::new()
487488
.app_data(Data::new(state.tiles.clone()))

0 commit comments

Comments
 (0)