3b9a4041 by astaxie

beego: support other analisys & fix typo

1 parent a6f55b59
...@@ -152,7 +152,7 @@ func (input *BeegoInput) IsWebsocket() bool { ...@@ -152,7 +152,7 @@ func (input *BeegoInput) IsWebsocket() bool {
152 152
153 // IsSecure returns boolean of whether file uploads in this request or not.. 153 // IsSecure returns boolean of whether file uploads in this request or not..
154 func (input *BeegoInput) IsUpload() bool { 154 func (input *BeegoInput) IsUpload() bool {
155 return input.Header("Content-Type") == "multipart/form-data" 155 return strings.Contains(input.Header("Content-Type"), "multipart/form-data")
156 } 156 }
157 157
158 // IP returns request client ip. 158 // 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)
556 goto Admin 556 goto Admin
557 } 557 }
558 558
559 if context.Input.IsPost() { 559 if !context.Input.IsGet() && !context.Input.IsHead() {
560 if CopyRequestBody && !context.Input.IsUpload() { 560 if CopyRequestBody && !context.Input.IsUpload() {
561 context.Input.CopyBody() 561 context.Input.CopyBody()
562 } 562 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!