Skip to content

Commit

Permalink
CORS: skip preflight if route is RouteNotFound
Browse files Browse the repository at this point in the history
  • Loading branch information
System-Glitch committed May 17, 2024
1 parent d3f977d commit b90805b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (m *corsMiddleware) Handle(next Handler) Handler {

options.ConfigureCommon(headers, requestHeaders)

if request.Method() == http.MethodOptions {
if request.Method() == http.MethodOptions && request.Route.GetName() != RouteNotFound {
options.HandlePreflight(headers, requestHeaders)
if options.OptionsPassthrough {
next(response, request)
Expand Down

0 comments on commit b90805b

Please sign in to comment.