3f0e55de by astaxie

reverse pull request 397, it not a bug. Just should this way

1 parent 235d2740
...@@ -574,11 +574,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -574,11 +574,9 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
574 n := len(requestPath) 574 n := len(requestPath)
575 if requestPath == route.pattern { 575 if requestPath == route.pattern {
576 runrouter = route.controllerType 576 runrouter = route.controllerType
577 findrouter = true
577 runMethod = p.getRunMethod(r.Method, context, route) 578 runMethod = p.getRunMethod(r.Method, context, route)
578 if runMethod != "" { 579 break
579 findrouter = true
580 break
581 }
582 } 580 }
583 // pattern /admin url /admin 200 /admin/ 404 581 // pattern /admin url /admin 200 /admin/ 404
584 // pattern /admin/ url /admin 301 /admin/ 200 582 // pattern /admin/ url /admin 301 /admin/ 200
...@@ -618,12 +616,10 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -618,12 +616,10 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
618 r.URL.RawQuery = url.Values(values).Encode() 616 r.URL.RawQuery = url.Values(values).Encode()
619 } 617 }
620 runrouter = route.controllerType 618 runrouter = route.controllerType
619 findrouter = true
621 context.Input.Params = params 620 context.Input.Params = params
622 runMethod = p.getRunMethod(r.Method, context, route) 621 runMethod = p.getRunMethod(r.Method, context, route)
623 if runMethod != "" { 622 break
624 findrouter = true
625 break
626 }
627 } 623 }
628 } 624 }
629 625
...@@ -805,8 +801,9 @@ func (p *ControllerRegistor) getRunMethod(method string, context *beecontext.Con ...@@ -805,8 +801,9 @@ func (p *ControllerRegistor) getRunMethod(method string, context *beecontext.Con
805 return m 801 return m
806 } else if m, ok = router.methods["*"]; ok { 802 } else if m, ok = router.methods["*"]; ok {
807 return m 803 return m
804 } else {
805 return strings.Title(method)
808 } 806 }
809 return ""
810 } else { 807 } else {
811 return strings.Title(method) 808 return strings.Title(method)
812 } 809 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!