From 1fcf46219557a6e4bb2154c0464bf834316501bb Mon Sep 17 00:00:00 2001 From: Jonathan Brown Date: Mon, 3 Oct 2016 17:06:13 +0700 Subject: [PATCH] Set CORS Max-Age to avoid a preflight OPTIONS request for every request. --- 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) }