From 23bb36d35cf83ca8b95c4432aa846326530d24b9 Mon Sep 17 00:00:00 2001 From: astaxie Date: Mon, 18 Jan 2016 23:29:56 +0800 Subject: [PATCH] fix the issue #1573 --- router.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/router.go b/router.go index 0e1d1d32..726936de 100644 --- a/router.go +++ b/router.go @@ -640,6 +640,13 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request) goto Admin } + if r.Method != "GET" && r.Method != "HEAD" { + if BConfig.CopyRequestBody && !context.Input.IsUpload() { + context.Input.CopyBody(BConfig.MaxMemory) + } + context.Input.ParseFormOrMulitForm(BConfig.MaxMemory) + } + // session init if BConfig.WebConfig.Session.SessionOn { var err error @@ -656,13 +663,6 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request) }() } - if r.Method != "GET" && r.Method != "HEAD" { - if BConfig.CopyRequestBody && !context.Input.IsUpload() { - context.Input.CopyBody(BConfig.MaxMemory) - } - context.Input.ParseFormOrMulitForm(BConfig.MaxMemory) - } - if p.execFilter(context, BeforeRouter, urlPath) { goto Admin }