From 3b9a40413819ed2bef7c228e8228a4a2f0ee3e81 Mon Sep 17 00:00:00 2001 From: astaxie Date: Mon, 28 Apr 2014 18:07:30 +0800 Subject: [PATCH] beego: support other analisys & fix typo --- context/input.go | 2 +- fiter_test.go => filter_test.go | 0 router.go | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename fiter_test.go => filter_test.go (100%) 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() }