Explorar el Código

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

Jonathan Brown hace 9 años
padre
commit
ae341b31c8
Se han modificado 1 ficheros con 1 adiciones y 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)
 }