From bc93c80b56e66a1c382f8d8c5195be4447c324f6 Mon Sep 17 00:00:00 2001 From: Masoud Ghiasi Date: Mon, 22 Jul 2019 12:26:55 +0430 Subject: [PATCH] fix: Support preflight of auth libraries in js --- examples/gateway/handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/gateway/handlers.go b/examples/gateway/handlers.go index 3db3fc3bf2b..ead3bb5bf3b 100644 --- a/examples/gateway/handlers.go +++ b/examples/gateway/handlers.go @@ -46,7 +46,7 @@ func allowCORS(h http.Handler) http.Handler { // CORS from any origin using the methods "GET", "HEAD", "POST", "PUT", "DELETE" // We insist, don't do this without consideration in production systems. func preflightHandler(w http.ResponseWriter, r *http.Request) { - headers := []string{"Content-Type", "Accept"} + headers := []string{"Content-Type", "Accept", "Authorization"} w.Header().Set("Access-Control-Allow-Headers", strings.Join(headers, ",")) methods := []string{"GET", "HEAD", "POST", "PUT", "DELETE"} w.Header().Set("Access-Control-Allow-Methods", strings.Join(methods, ","))