Skip to content

Commit

Permalink
fix: upper-case request method
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Koch committed Apr 11, 2022
1 parent e154d22 commit 67bff2e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion handler/middleware/allowed_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ func NewAllowedMethodsHandler(allowedMethods, defaultAllowedMethods []string, al
}

func (a *AllowedMethodsHandler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
if _, ok := a.allowedMethods[req.Method]; !ok {
method := strings.ToUpper(req.Method)
if _, ok := a.allowedMethods[method]; !ok {
a.notAllowedHandler.ServeHTTP(rw, req)
return
}
Expand Down

0 comments on commit 67bff2e

Please sign in to comment.