Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to change POST max size #163

Closed
mastrolinux opened this issue Nov 28, 2014 · 3 comments
Closed

No way to change POST max size #163

mastrolinux opened this issue Nov 28, 2014 · 3 comments

Comments

@mastrolinux
Copy link

In the http module usually you can do:

req.Body = http.MaxBytesReader(rw, req.Body, 5 << 20)

and have a byte limit on POST request as big as you want. In gin there is no Body so it is very hard to change these settings.

Is there a workaround? Can you implement a POST max size limit configuration?

@tomsteele
Copy link

I've done:

c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, size)

And it has worked.

@mastrolinux
Copy link
Author

Will give it a try, thanks.

@mastrolinux
Copy link
Author

I think you have the Context just after the POST is submitted but it is not submitted if the size is bigger than the limit. Your approach works to decrease the size but not to increase it apparently. I guess the Context is callable inside the request only.

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

No branches or pull requests

3 participants