Skip to content

add request max body size limit #217

Merged
devfeel merged 9 commits intodevfeel:developfrom
wziww:master
Oct 29, 2019
Merged

add request max body size limit #217
devfeel merged 9 commits intodevfeel:developfrom
wziww:master

Conversation

@wziww
Copy link
Contributor

@wziww wziww commented Oct 25, 2019

The situation that if we do not limit the request's body size,the func ioutil.ReadAll(req.Body) will caused OOM very soon if body size is very large.

To limit the request's body size to be read
which can avoid unexpected or malicious request to cause the service's OOM

  • default is 32 << 20 (32 mb)
  • -1 : unlimted
  • 0 : use default value
  • else: use other value

@wziww wziww changed the base branch from master to develop October 28, 2019 08:12
“r.httpCtx = ctx” move to Request.reset
add “req.httpCtx = ctx” in Request.reset
@devfeel devfeel merged commit d17c05a into devfeel:develop Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants