mirror of
https://github.com/astaxie/beego.git
synced 2025-08-31 00:57:32 +00:00
fix: response http 413 when body size larger then MaxMemory.
This commit is contained in:
@@ -707,6 +707,10 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
||||
|
||||
if r.Method != http.MethodGet && r.Method != http.MethodHead {
|
||||
if BConfig.CopyRequestBody && !context.Input.IsUpload() {
|
||||
if r.ContentLength > BConfig.MaxMemory {
|
||||
exception("413", context)
|
||||
goto Admin
|
||||
}
|
||||
context.Input.CopyBody(BConfig.MaxMemory)
|
||||
}
|
||||
context.Input.ParseFormOrMulitForm(BConfig.MaxMemory)
|
||||
|
Reference in New Issue
Block a user