Skip to content

Commit b34c109

Browse files
Merge pull request #286 from crabnebula-dev/feat/csp-any
feat: allow accessing the instrumentation server on any URL
2 parents 836ac88 + 6f4d151 commit b34c109

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

crates/devtools-core/src/server.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use devtools_wire_format::sources::sources_server::SourcesServer;
99
use devtools_wire_format::tauri::tauri_server;
1010
use devtools_wire_format::tauri::tauri_server::TauriServer;
1111
use futures::{FutureExt, TryStreamExt};
12-
use http::HeaderValue;
1312
use std::net::SocketAddr;
1413
use tokio::sync::mpsc;
1514
use tonic::codegen::http::Method;
@@ -55,13 +54,8 @@ impl Server {
5554
let cors = CorsLayer::new()
5655
// allow `GET` and `POST` when accessing the resource
5756
.allow_methods([Method::GET, Method::POST])
58-
.allow_headers(AllowHeaders::any());
59-
60-
let cors = if option_env!("__DEVTOOLS_LOCAL_DEVELOPMENT").is_some() {
61-
cors.allow_origin(tower_http::cors::Any)
62-
} else {
63-
cors.allow_origin(HeaderValue::from_str("https://devtools.crabnebula.dev").unwrap())
64-
};
57+
.allow_headers(AllowHeaders::any())
58+
.allow_origin(tower_http::cors::Any);
6559

6660
let router = tonic::transport::Server::builder()
6761
.accept_http1(true)

0 commit comments

Comments
 (0)