9e4d886a by astaxie

filter http method fix #279

1 parent b6446659
...@@ -311,6 +311,11 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -311,6 +311,11 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
311 context.Input.CruSession = GlobalSessions.SessionStart(w, r) 311 context.Input.CruSession = GlobalSessions.SessionStart(w, r)
312 } 312 }
313 313
314 if !inSlice(strings.ToLower(r.Method), HTTPMETHOD) {
315 http.Error(w, "Method Not Allowed", 405)
316 return
317 }
318
314 var runrouter *controllerInfo 319 var runrouter *controllerInfo
315 var findrouter bool 320 var findrouter bool
316 321
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!