Skip to content

Commit

Permalink
preserve cors behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
tsachiherman committed Oct 18, 2023
1 parent cd04a94 commit cc6606f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/soroban-rpc/internal/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,10 @@ func NewJSONRPCHandler(cfg *config.Config, params HandlerParams) Handler {
handler = http.MaxBytesHandler(handler, maxHTTPRequestSize)

corsMiddleware := cors.New(cors.Options{
AllowedOrigins: []string{"*"},
AllowedHeaders: []string{"*"},
AllowedMethods: []string{"GET", "PUT", "POST", "PATCH", "DELETE", "HEAD", "OPTIONS"},
AllowedOrigins: []string{},
AllowOriginRequestFunc: func(*http.Request, string) bool { return true },
AllowedHeaders: []string{"*"},
AllowedMethods: []string{"GET", "PUT", "POST", "PATCH", "DELETE", "HEAD", "OPTIONS"},
})

return Handler{
Expand Down

0 comments on commit cc6606f

Please sign in to comment.