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 a0a1faa commit 4490000
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 4490000

Please sign in to comment.