Skip to content

Commit

Permalink
Make CORS permissive (#385)
Browse files Browse the repository at this point in the history
* fix: make cors permissive

* style: format
  • Loading branch information
mhchia authored Nov 15, 2023
1 parent 022b2bd commit 6270dd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions notary-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ tokio = { version = "1", features = ["full"] }
tokio-rustls = { version = "0.24.1" }
tokio-util = { version = "0.7", features = ["compat"] }
tower = { version = "0.4.12", features = ["make"] }
tower-http = { version = "0.4.4", features = ["cors"] }
tracing = "0.1"
tracing-opentelemetry = "0.19"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
Expand Down
2 changes: 2 additions & 0 deletions notary-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use std::{
pin::Pin,
sync::Arc,
};
use tower_http::cors::CorsLayer;

use tokio::{fs::File, net::TcpListener};
use tokio_rustls::TlsAcceptor;
Expand Down Expand Up @@ -137,6 +138,7 @@ pub async fn run_server(config: &NotaryServerProperties) -> Result<(), NotarySer
NotaryGlobals,
>(notary_globals.clone()))
.route("/notarize", get(upgrade_protocol))
.layer(CorsLayer::permissive())
.with_state(notary_globals);
let mut app = router.into_make_service();

Expand Down

0 comments on commit 6270dd8

Please sign in to comment.