From db2b986b54d382dd9855e5e2b0f49251fe10801b Mon Sep 17 00:00:00 2001 From: Jonathan Brown Date: Mon, 3 Oct 2016 18:03:55 +0700 Subject: [PATCH] rpc: set CORS Max-Age to avoid a preflight OPTIONS request for every command --- rpc/http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/rpc/http.go b/rpc/http.go index afcdd4bd64..72a991b313 100644 --- a/rpc/http.go +++ b/rpc/http.go @@ -170,6 +170,7 @@ func newCorsHandler(srv *Server, corsString string) http.Handler { c := cors.New(cors.Options{ AllowedOrigins: allowedOrigins, AllowedMethods: []string{"POST", "GET"}, + MaxAge: 3600, }) return c.Handler(srv) }