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 24, 2021
1 parent b052104 commit ccec19a
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 @@ -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 ccec19a

Please sign in to comment.