소스 검색

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

Jonathan Brown 9 년 전
부모
커밋
ae341b31c8
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  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)
 }