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

Set max request size to 4MiB #338

Merged
merged 1 commit into from Jan 21, 2022
Merged

Conversation

nsmith5
Copy link
Contributor

@nsmith5 nsmith5 commented Jan 20, 2022

Summary

Fixes the the max request body size to 4MiB (Just a guess at a size.... may it could be smaller?) so that it isn't unbound. Implemented using a new api.WithMaxBytes middleware. There is a small refactor of how we wire up stuff for the API server here as well to make it a little easier to understand. As adding the body limiting middleware was part of that wire up it seemed a good thing to clean up with this work.

Ticket Link

Fixes #335

Release Note

* Set max request size to 4MiB so that request size isn't unbound

Signed-off-by: Nathan Smith <nathan@nfsmith.ca>
@nsmith5
Copy link
Contributor Author

nsmith5 commented Jan 20, 2022

The diff algorithm made this one a little odd to read. Sorry ya'll 😅

@dlorenc
Copy link
Member

dlorenc commented Jan 21, 2022

Thanks!

@dlorenc dlorenc merged commit ad6b988 into sigstore:main Jan 21, 2022
@nsmith5 nsmith5 deleted the prevent-oom-on-signing branch January 21, 2022 15:33
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.

Unbound request size can lead to OOM
2 participants