beego: support other analisys & fix typo
Showing
3 changed files
with
2 additions
and
2 deletions
| ... | @@ -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. | ... | ... |
File moved
| ... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment