Merge pull request #4401 from changsongl/fix-any-route-logic
fix router:AddMethod logic error, remove unreachable code
This commit is contained in:
commit
32557769fc
@ -390,15 +390,9 @@ func (p *ControllerRegister) AddMethod(method, pattern string, f FilterFunc) {
|
||||
}
|
||||
route.methods = methods
|
||||
for k := range methods {
|
||||
if k == "*" {
|
||||
for m := range HTTPMETHOD {
|
||||
p.addToRouter(m, pattern, route)
|
||||
}
|
||||
} else {
|
||||
p.addToRouter(k, pattern, route)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handler add user defined Handler
|
||||
func (p *ControllerRegister) Handler(pattern string, h http.Handler, options ...interface{}) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user