Merge pull request #3081 from ethernomad/cors-max-age

rpc: set CORS Max-Age to reduce preflight OPTIONS requests
This commit is contained in:
Péter Szilágyi 2016-10-05 16:47:10 +03:00 committed by GitHub
commit 2acb9a6ea7
1 changed files with 1 additions and 0 deletions

View File

@ -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)
}