Skip to content

Commit

Permalink
turn on HandleMethodNotAllowed when using NoMethod #2871 (#2872)
Browse files Browse the repository at this point in the history
  • Loading branch information
togettoyou authored and thinkerou committed Nov 23, 2021
1 parent 77dfd52 commit 103a566
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gin.go
Expand Up @@ -264,8 +264,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 103a566

Please sign in to comment.