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

Upload size validation for each file #423

Merged
merged 3 commits into from
Mar 5, 2014
Merged

Upload size validation for each file #423

merged 3 commits into from
Mar 5, 2014

Conversation

garcia-jj
Copy link
Member

No description provided.

@@ -50,6 +50,11 @@ public long getSizeLimit() {
}

@Override
public long getFileSizeLimit() {
return 2 * 1024 * 1024;
Copy link
Member Author

Choose a reason for hiding this comment

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

may we can grow this value to Long.MAX_VALUE and allow app to define lower values.

Copy link
Member

Choose a reason for hiding this comment

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

It's kind of a security problem. If we leave this unlimited, someone can start 10 uploads with 2Gb and break the server.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok then

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Lucas! It's better to leave as it is!

On Wed, Mar 5, 2014 at 11:38 AM, Lucas Cavalcanti
notifications@gitpro.ttaallkk.topwrote:

In
vraptor-core/src/main/java/br/com/caelum/vraptor/observer/upload/DefaultMultipartConfig.java:

@@ -50,6 +50,11 @@ public long getSizeLimit() {
}

@Override
  • public long getFileSizeLimit() {
  •   return 2 \* 1024 \* 1024;
    

It's kind of a security problem. If we leave this unlimited, someone can
start 10 uploads with 2Gb and break the server.

Reply to this email directly or view it on GitHubhttps://github.com//pull/423/files#r10301148
.

Rafael Ponte
http://cursos.triadworks.com.br

Copy link
Member Author

Choose a reason for hiding this comment

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

Can I merge the original pull request?

@@ -27,13 +27,20 @@
public interface MultipartConfig {

/**
* The max size of uploaded files (in bytes).
* The max size of uploaded files (in bytes). Default value is 2MB.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this should be on the interface. Only the implementation sets 2MB.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure about the best place, since the text says "the default value if". Done by 55286a5.

@lucascs
Copy link
Member

lucascs commented Mar 5, 2014

🐑

garcia-jj added a commit that referenced this pull request Mar 5, 2014
@garcia-jj garcia-jj merged commit 8b77147 into caelum:master Mar 5, 2014
@garcia-jj garcia-jj deleted the ot-uploadsizeforeachfile branch March 5, 2014 16:06
@Turini Turini added this to the 4.0.0-RCF milestone Mar 6, 2014
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.

4 participants