mirror of
https://github.com/astaxie/beego.git
synced 2024-12-23 00:10:50 +00:00
filter http method fix #279
This commit is contained in:
parent
b644665952
commit
9e4d886a6c
@ -311,6 +311,11 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
context.Input.CruSession = GlobalSessions.SessionStart(w, r)
|
context.Input.CruSession = GlobalSessions.SessionStart(w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !inSlice(strings.ToLower(r.Method), HTTPMETHOD) {
|
||||||
|
http.Error(w, "Method Not Allowed", 405)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var runrouter *controllerInfo
|
var runrouter *controllerInfo
|
||||||
var findrouter bool
|
var findrouter bool
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user