1
0
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:
astaxie 2013-11-07 22:10:46 +08:00
parent b644665952
commit 9e4d886a6c

View File

@ -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