Skip to content

[#1112] Allow to limit the size of whole request or the size of one uploaded file in a request#1110

Merged
asolntsev merged 1 commit intoplayframework:masterfrom
codeborne:uploadSizeFix
Feb 22, 2017
Merged

[#1112] Allow to limit the size of whole request or the size of one uploaded file in a request#1110
asolntsev merged 1 commit intoplayframework:masterfrom
codeborne:uploadSizeFix

Conversation

@cbxp
Copy link
Contributor

@cbxp cbxp commented Feb 20, 2017

…file in a request.

The configuration parameters are: 'upload.sizeMax' and 'upload.fileSizeMax'.
The defaults stay the same -1 which means 'unlimited'.

@asolntsev asolntsev self-assigned this Feb 21, 2017
@asolntsev asolntsev requested a review from xael-fry February 21, 2017 15:24
@asolntsev
Copy link
Contributor

@xael-fry This is definitely good PR. I suggest to merge it ASAP.

Copy link
Member

@xael-fry xael-fry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the documentation with the new parameters?

@xael-fry xael-fry changed the title Allow to limit the size of whole request or the size of one uploaded … [#1112] Allow to limit the size of whole request or the size of one uploaded file in a request Feb 22, 2017
@xael-fry xael-fry added this to the 1.5.0 milestone Feb 22, 2017
@cbxp cbxp force-pushed the uploadSizeFix branch 2 times, most recently from 224e374 to 195c9cd Compare February 22, 2017 07:43
@cbxp
Copy link
Contributor Author

cbxp commented Feb 22, 2017

@xael-fry We have updated the documentation.
By the way, I suggest to put some reasonable default values. Say,

upload.maxFileSize=10240   (10 mb)
upload.maxRequestSize=30720  (30 mb)

Without that, it's possible that hacker can upload 100TB file to server.

@@ -612,12 +612,12 @@ public Map<String, String[]> parse(InputStream body) {
* The maximum size permitted for the complete request, as opposed to
* {@link #fileSizeMax}. A value of -1 indicates no maximum.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fileSizeMax no longer exist as you rename it

…ze of one uploaded file in a request.

 The configuration parameters are: 'upload.sizeMax' and 'upload.fileSizeMax'.
 The defaults stay the same -1 which means 'unlimited'.
@asolntsev
Copy link
Contributor

asolntsev commented Feb 22, 2017

@xael-fry Fixed parameter name in javadoc, thank you. What about setting default values to something reasonable?

@xael-fry
Copy link
Member

@asolntsev I don't think we should define default value here, some user handle request size limit with a a front apache server, so setting new value may cause conflict when upgrading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants