From 423f4a7a906ad336a2853ebd6eb837bf7c0c0572 Mon Sep 17 00:00:00 2001 From: perekopskiy <53865202+perekopskiy@users.noreply.github.com> Date: Mon, 1 Apr 2024 10:25:13 +0300 Subject: [PATCH] fix(contract-verifier-api): permissive cors for contract verifier api server (#1525) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ Sets permissive CORS for contract verifier api server ## Why ❔ To have same cors as we had with actix ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. - [ ] Linkcheck has been run via `zk linkcheck`. --- .../src/api_server/contract_verification/api_decl.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/lib/zksync_core/src/api_server/contract_verification/api_decl.rs b/core/lib/zksync_core/src/api_server/contract_verification/api_decl.rs index 5e0e4d701ac..256062936d3 100644 --- a/core/lib/zksync_core/src/api_server/contract_verification/api_decl.rs +++ b/core/lib/zksync_core/src/api_server/contract_verification/api_decl.rs @@ -1,5 +1,6 @@ use std::sync::Arc; +use tower_http::cors::CorsLayer; use zksync_dal::{ConnectionPool, Core}; #[derive(Debug, Clone)] @@ -49,6 +50,7 @@ impl RestApi { "/contract_verification/info/:address", axum::routing::get(Self::verification_info), ) + .layer(CorsLayer::permissive()) .with_state(Arc::new(self)) } }