From 954c4b6abf9f901160bdf4160ebd637bc88528c4 Mon Sep 17 00:00:00 2001 From: Yaiba <4yaiba@gmail.com> Date: Tue, 7 Nov 2023 16:16:38 -0800 Subject: [PATCH] feat: enable cors Access-Control-Allow-Credentials (#384) --- internal/services/grpc_gateway/middleware/cors/cors.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/services/grpc_gateway/middleware/cors/cors.go b/internal/services/grpc_gateway/middleware/cors/cors.go index d71258ac4..93cb695eb 100644 --- a/internal/services/grpc_gateway/middleware/cors/cors.go +++ b/internal/services/grpc_gateway/middleware/cors/cors.go @@ -36,6 +36,7 @@ func MCors(cors []string) *middleware.NamedMiddleware { w.Header().Set("Access-Control-Allow-Origin", r.Header.Get("Origin")) w.Header().Set("Access-Control-Allow-Methods", AllowMethods) w.Header().Set("Access-Control-Allow-Headers", AllowHeaders) + w.Header().Set("Access-Control-Allow-Credentials", "true") } if r.Method == "OPTIONS" {