Skip to content

Commit

Permalink
update cors
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdeafbeef committed Aug 29, 2023
1 parent e528a68 commit f2c2c14
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,7 @@ impl Server {
// Prepare middleware
let service = ServiceBuilder::new()
.layer(DefaultBodyLimit::max(MAX_REQUEST_SIZE))
.layer(
CorsLayer::new()
.allow_headers(AllowHeaders::list([
axum::http::header::AUTHORIZATION,
axum::http::header::CONTENT_TYPE,
]))
.allow_origin(AllowOrigin::any())
.allow_methods(AllowMethods::list([
axum::http::Method::GET,
axum::http::Method::POST,
axum::http::Method::OPTIONS,
axum::http::Method::PUT,
])),
)
.layer(CorsLayer::permissive())
.layer(TimeoutLayer::new(Duration::from_secs(25)));

#[cfg(feature = "compression")]
Expand Down

0 comments on commit f2c2c14

Please sign in to comment.