From ae341b31c869bc77decaf843fc2417f386440d77 Mon Sep 17 00:00:00 2001 From: Jonathan Brown Date: Mon, 3 Oct 2016 18:18:46 +0700 Subject: [PATCH] rpc: set CORS Max-Age to reduce preflight OPTIONS requests --- rpc/http.go | 1 + 1 file changed, 1 insertion(+) diff --git a/rpc/http.go b/rpc/http.go index afcdd4bd6..c923580bf 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: 600, }) return c.Handler(srv) }