1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 07:01:28 +00:00

all the browser should support delete and put now

This commit is contained in:
astaxie 2016-01-03 20:36:16 +08:00
parent 9519fc6c96
commit 6585e66f97

View File

@ -664,12 +664,6 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if !findrouter { if !findrouter {
httpMethod := r.Method httpMethod := r.Method
if httpMethod == "POST" && context.Input.Query("_method") == "PUT" {
httpMethod = "PUT"
}
if httpMethod == "POST" && context.Input.Query("_method") == "DELETE" {
httpMethod = "DELETE"
}
if t, ok := p.routers[httpMethod]; ok { if t, ok := p.routers[httpMethod]; ok {
runObject := t.Match(urlPath, context) runObject := t.Match(urlPath, context)
if r, ok := runObject.(*controllerInfo); ok { if r, ok := runObject.(*controllerInfo); ok {