Commit 6e987bfd authored by astaxie's avatar astaxie

Merge branch 'develop' of https://github.com/astaxie/beego into develop

parents 918b9e51 12e5584c
...@@ -321,7 +321,8 @@ func (p *ControllerRegister) Any(pattern string, f FilterFunc) { ...@@ -321,7 +321,8 @@ func (p *ControllerRegister) Any(pattern string, f FilterFunc) {
// ctx.Output.Body("hello world") // ctx.Output.Body("hello world")
// }) // })
func (p *ControllerRegister) AddMethod(method, pattern string, f FilterFunc) { func (p *ControllerRegister) AddMethod(method, pattern string, f FilterFunc) {
if _, ok := HTTPMETHOD[strings.ToUpper(method)]; method != "*" && !ok { method = strings.ToUpper(method)
if _, ok := HTTPMETHOD[method]; method != "*" && !ok {
panic("not support http method: " + method) panic("not support http method: " + method)
} }
route := &controllerInfo{} route := &controllerInfo{}
...@@ -334,7 +335,7 @@ func (p *ControllerRegister) AddMethod(method, pattern string, f FilterFunc) { ...@@ -334,7 +335,7 @@ func (p *ControllerRegister) AddMethod(method, pattern string, f FilterFunc) {
methods[val] = val methods[val] = val
} }
} else { } else {
methods[strings.ToUpper(method)] = strings.ToUpper(method) methods[method] = method
} }
route.methods = methods route.methods = methods
for k := range methods { for k := range methods {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment