Skip to content

Commit

Permalink
Merge pull request #90 from near/serhii/cors3
Browse files Browse the repository at this point in the history
allow all cors (permisive)
  • Loading branch information
gutsyphilip authored Apr 20, 2023
2 parents 10822e6 + b9670a8 commit 3f08765
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions mpc-recovery/src/leader_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use std::collections::btree_map::Entry;
use std::collections::BTreeMap;
use std::net::SocketAddr;
use threshold_crypto::{PublicKeySet, SecretKeyShare};
use tower_http::cors::Any;

pub struct Config {
pub id: NodeId,
Expand Down Expand Up @@ -89,11 +88,8 @@ pub async fn run(config: Config) {
account_creator_sk,
};

//TODO: now secure, allow only for testnet, whitelist for mainnet
let cors_layer = tower_http::cors::CorsLayer::new()
.allow_origin(Any)
.allow_methods(Any)
.allow_headers(Any);
//TODO: not secure, allow only for testnet, whitelist endpoint etc. for mainnet
let cors_layer = tower_http::cors::CorsLayer::permissive();

let app = Router::new()
.route("/submit", post(submit::<UniversalTokenVerifier>))
Expand Down

0 comments on commit 3f08765

Please sign in to comment.