Skip to content

Commit

Permalink
turn on HandleMethodNotAllowed when using NoMethod gin-gonic#2871 (gi…
Browse files Browse the repository at this point in the history
…n-gonic#2872)

(cherry picked from commit d6534cc)
  • Loading branch information
togettoyou authored and Bisstocuz committed Nov 22, 2021
1 parent 92eeaa4 commit 5bd2f6e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,9 @@ func (engine *Engine) NoRoute(handlers ...HandlerFunc) {
engine.rebuild404Handlers()
}

// NoMethod sets the handlers called when... TODO.
// NoMethod sets the handlers called when NoMethod.
func (engine *Engine) NoMethod(handlers ...HandlerFunc) {
engine.HandleMethodNotAllowed = true
engine.noMethod = handlers
engine.rebuild405Handlers()
}
Expand Down

0 comments on commit 5bd2f6e

Please sign in to comment.