diff --git a/router.go b/router.go index 7194bd29..2a88490d 100644 --- a/router.go +++ b/router.go @@ -648,20 +648,16 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) } if !findrouter { - http_method := "" + http_method := r.Method - if r.Method == "POST" && context.Input.Query("_method") == "PUT" { + if http_method == "POST" && context.Input.Query("_method") == "PUT" { http_method = "PUT" } - if r.Method == "POST" && context.Input.Query("_method") == "DELETE" { + if http_method == "POST" && context.Input.Query("_method") == "DELETE" { http_method = "DELETE" } - if http_method != "PUT" && http_method != "DELETE" { - http_method = r.Method - } - if t, ok := p.routers[http_method]; ok { runObject, p := t.Match(urlPath) if r, ok := runObject.(*controllerInfo); ok {