-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Added SizeLimitHandler #8774
Added SizeLimitHandler #8774
Conversation
jetty-server/src/main/java/org/eclipse/jetty/server/handler/SizeLimitHandler.java
Outdated
Show resolved
Hide resolved
if (contentLength < 0) | ||
contentLength = baseRequest.getHttpFields().getLongField("X-Content-Encoding"); | ||
if (contentLength > _requestLimit) | ||
throw new BadMessageException(413, "Request Body too large"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Order of interceptors is important.
If this is after the GzipHandler then you are basing the limits on uncompressed request/response.
Before the GzipHandler and you are basing the limits on raw network bytes.
Right?
Seems like an important detail for the javadoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I removed the special handling for X-Content-Encoding, as that muddied the picture. I'll add some javadoc.
added tests
+ Improved javadoc + single interceptor instance + wrapped response
jetty-server/src/main/java/org/eclipse/jetty/server/handler/SizeLimitHandler.java
Outdated
Show resolved
Hide resolved
@lachlan-roberts can you re-review |
Don't forget to add PRs and Issues to projects. |
Add SizeLimitHandler