Commit b2a69f50 authored by astaxie's avatar astaxie

beego: support other analisys & fix typo

parent b2bd829d
...@@ -152,7 +152,7 @@ func (input *BeegoInput) IsWebsocket() bool { ...@@ -152,7 +152,7 @@ func (input *BeegoInput) IsWebsocket() bool {
// IsSecure returns boolean of whether file uploads in this request or not.. // IsSecure returns boolean of whether file uploads in this request or not..
func (input *BeegoInput) IsUpload() bool { func (input *BeegoInput) IsUpload() bool {
return input.Header("Content-Type") == "multipart/form-data" return strings.Contains(input.Header("Content-Type"), "multipart/form-data")
} }
// IP returns request client ip. // IP returns request client ip.
......
...@@ -556,7 +556,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) ...@@ -556,7 +556,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
goto Admin goto Admin
} }
if context.Input.IsPost() { if !context.Input.IsGet() && !context.Input.IsHead() {
if CopyRequestBody && !context.Input.IsUpload() { if CopyRequestBody && !context.Input.IsUpload() {
context.Input.CopyBody() context.Input.CopyBody()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment