fix: Apply WS CORS regardless of HTTP being enabled (#18729)

This commit is contained in:
anim001k
2025-09-26 13:53:52 +02:00
committed by GitHub
parent ff4cc6e3ba
commit 8852269a7d

View File

@@ -195,13 +195,16 @@ impl RethRpcServerConfig for RpcServerArgs {
.with_http_address(socket_address)
.with_http(self.http_ws_server_builder())
.with_http_cors(self.http_corsdomain.clone())
.with_http_disable_compression(self.http_disable_compression)
.with_ws_cors(self.ws_allowed_origins.clone());
.with_http_disable_compression(self.http_disable_compression);
}
if self.ws {
let socket_address = SocketAddr::new(self.ws_addr, self.ws_port);
config = config.with_ws_address(socket_address).with_ws(self.http_ws_server_builder());
// Ensure WS CORS is applied regardless of HTTP being enabled
config = config
.with_ws_address(socket_address)
.with_ws(self.http_ws_server_builder())
.with_ws_cors(self.ws_allowed_origins.clone());
}
if self.is_ipc_enabled() {