From a003f34cdb510c37d7245f0965814a6168243812 Mon Sep 17 00:00:00 2001 From: Jaz Date: Sat, 19 Oct 2024 14:24:12 -0700 Subject: [PATCH] Explicitly allow all origins in websocket upgrader --- pkg/server/server.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/server/server.go b/pkg/server/server.go index 1f1ced2..78bd318 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -28,7 +28,12 @@ type Server struct { seq int64 } -var upgrader = websocket.Upgrader{} +var upgrader = websocket.Upgrader{ + // Allow all origins in websocket upgrade requests + CheckOrigin: func(r *http.Request) bool { + return true + }, +} var maxConcurrentEmits = int64(100) var cutoverThresholdUS = int64(1_000_000) var tracer = otel.Tracer("jetstream-server")