From d04e6686ca6c69d119c5277baa2c0938ac02abaf Mon Sep 17 00:00:00 2001 From: rjshrjndrn Date: Fri, 21 Mar 2025 15:50:03 +0100 Subject: [PATCH] fix(helm): add CORS config to Assist ingress Configure CORS headers and debug session information for the Assist service's ingress to ensure proper cross-origin requests handling and improved debugging capabilities. Signed-off-by: rjshrjndrn --- .../openreplay/charts/assist/values.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/helmcharts/openreplay/charts/assist/values.yaml b/scripts/helmcharts/openreplay/charts/assist/values.yaml index bf2149df5..0a5b78733 100644 --- a/scripts/helmcharts/openreplay/charts/assist/values.yaml +++ b/scripts/helmcharts/openreplay/charts/assist/values.yaml @@ -70,6 +70,22 @@ ingress: enabled: true className: "{{ .Values.global.ingress.controller.ingressClassResource.name }}" annotations: + nginx.ingress.kubernetes.io/configuration-snippet: | + add_header X-Debug-Session-ID $http_sessionid; + add_header X-Debug-Session-Type "wss"; + + # CORS configuration + # We don't need the upstream header + proxy_hide_header Access-Control-Allow-Origin; + add_header 'Access-Control-Allow-Credentials' 'true'; + add_header 'Access-Control-Allow-Origin' $http_origin always; + add_header 'Access-Control-Allow-Methods' 'GET, OPTIONS' always; + add_header 'Access-Control-Allow-Headers' 'sessionid, Content-Type, Authorization' always; + add_header 'Access-Control-Max-Age' 1728000; + add_header 'Content-Type' 'text/plain charset=UTF-8'; + add_header 'Content-Length' 0; + return 204; + nginx.ingress.kubernetes.io/proxy-read-timeout: "3600" nginx.ingress.kubernetes.io/proxy-send-timeout: "3600" # kubernetes.io/ingress.class: nginx