diff --git a/context/input.go b/context/input.go index 8d9b76e6..c405b27e 100644 --- a/context/input.go +++ b/context/input.go @@ -152,7 +152,7 @@ func (input *BeegoInput) IsWebsocket() bool { // IsSecure returns boolean of whether file uploads in this request or not.. 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. diff --git a/fiter_test.go b/filter_test.go similarity index 100% rename from fiter_test.go rename to filter_test.go diff --git a/router.go b/router.go index fa88a153..44963cbf 100644 --- a/router.go +++ b/router.go @@ -556,7 +556,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request) goto Admin } - if context.Input.IsPost() { + if !context.Input.IsGet() && !context.Input.IsHead() { if CopyRequestBody && !context.Input.IsUpload() { context.Input.CopyBody() }