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

Limiting the request size #113

Open
dunnl opened this issue Mar 1, 2017 · 2 comments
Open

Limiting the request size #113

dunnl opened this issue Mar 1, 2017 · 2 comments
Labels

Comments

@dunnl
Copy link

dunnl commented Mar 1, 2017

requestSizeCheck modifies a request to embed size-checking inside the responseBody instead of performing the check immediately. (And I presume this is on purpose.)

My concern is the error handling suggests that the exception could be thrown at this line in handleRequest' but I don't think makeActionEnvironment forces the evaluation of the request body either. If it does though, then getErrorHandler config status413 is fed into respStateToResponse, which throw an error.

Thoughts?

@dunnl dunnl changed the title requestSizeCheck too lazy? Limiting the request size Mar 1, 2017
@dunnl
Copy link
Author

dunnl commented Mar 1, 2017

(Changed the title because initially I thought requestSizeCheck was the problem)

@agrafix
Copy link
Owner

agrafix commented Mar 1, 2017

The size check will be executed when the body is actually consumed and that's when the exception will trigger. It seems that you are correct that the exception will never be thrown at the line you mentioned. This was the case before as we already parsed the body there strictly before actually needing it. I guess one could remove the handler there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants