From 4e4e5fca541ae2c2c0bf5cde0b556fedfafa8d54 Mon Sep 17 00:00:00 2001 From: Micah Zoltu Date: Wed, 15 Mar 2017 20:34:08 -0700 Subject: [PATCH] rpc: add support for extended headers in CORS requests (#3783) Fixes #3762. Details about parameter: https://github.com/rs/cors/blob/a62a804a8a009876ca59105f7899938a1349f4b3/cors.go#L50-L54 --- rpc/http.go | 1 + swarm/api/http/server.go | 1 + 2 files changed, 2 insertions(+) diff --git a/rpc/http.go b/rpc/http.go index 7d4fe5d47..5a0770231 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -171,6 +171,7 @@ func newCorsHandler(srv *Server, corsString string) http.Handler { AllowedOrigins: allowedOrigins, AllowedMethods: []string{"POST", "GET"}, MaxAge: 600, + AllowedHeaders: []string{"*"}, }) return c.Handler(srv) } diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go index a61696678..ae113750f 100644 --- a/swarm/api/http/server.go +++ b/swarm/api/http/server.go @@ -82,6 +82,7 @@ func StartHttpServer(api *api.Api, server *Server) { AllowedOrigins: allowedOrigins, AllowedMethods: []string{"POST", "GET", "DELETE", "PATCH", "PUT"}, MaxAge: 600, + AllowedHeaders: []string{"*"}, }) hdlr := c.Handler(serveMux)