Commit 4e4e5fca authored by Micah Zoltu's avatar Micah Zoltu Committed by Felix Lange

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
parent 61ede867
...@@ -171,6 +171,7 @@ func newCorsHandler(srv *Server, corsString string) http.Handler { ...@@ -171,6 +171,7 @@ func newCorsHandler(srv *Server, corsString string) http.Handler {
AllowedOrigins: allowedOrigins, AllowedOrigins: allowedOrigins,
AllowedMethods: []string{"POST", "GET"}, AllowedMethods: []string{"POST", "GET"},
MaxAge: 600, MaxAge: 600,
AllowedHeaders: []string{"*"},
}) })
return c.Handler(srv) return c.Handler(srv)
} }
...@@ -82,6 +82,7 @@ func StartHttpServer(api *api.Api, server *Server) { ...@@ -82,6 +82,7 @@ func StartHttpServer(api *api.Api, server *Server) {
AllowedOrigins: allowedOrigins, AllowedOrigins: allowedOrigins,
AllowedMethods: []string{"POST", "GET", "DELETE", "PATCH", "PUT"}, AllowedMethods: []string{"POST", "GET", "DELETE", "PATCH", "PUT"},
MaxAge: 600, MaxAge: 600,
AllowedHeaders: []string{"*"},
}) })
hdlr := c.Handler(serveMux) hdlr := c.Handler(serveMux)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment