Explorar o código

rpc: set CORS Max-Age to reduce preflight OPTIONS requests

Jonathan Brown %!s(int64=9) %!d(string=hai) anos
pai
achega
ae341b31c8
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      rpc/http.go

+ 1 - 0
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)
 }