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

Handle multipart form upload with empty filename as BadPart #8880

Merged
merged 2 commits into from Dec 14, 2018

Conversation

Projects
None yet
3 participants
@mkurz
Copy link
Member

mkurz commented Dec 13, 2018

Fixes #8727 and #6203

This restores the behavior we had in Play 2.4 and before: When submitting a form and leaving a file field empty, the filename is empty. Like in Play 2.4, we should handle this as failure.
This line - which was removed - took care for this in Play 2.4 and below. Plus, as you can see in the comments of #8727 and #6203 people work around this problem by checking for an empty file name as well.

(After this pull request I will provide another one which actually also checks for the file itself if it's empty, not just the filename)

@marcospereira
Copy link
Member

marcospereira left a comment

LGTM.

Made two small suggestions.

Apply suggestions from code review
Co-Authored-By: mkurz <m.kurz@irregular.at>
@mkurz

This comment has been minimized.

Copy link
Member Author

mkurz commented Dec 13, 2018

@marcospereira thanks, let's see what Travis says 👍

@marcospereira
Copy link
Member

marcospereira left a comment

LGTM.

Let's wait for a green build. :-)

@mkurz mkurz merged commit f89cc02 into playframework:master Dec 14, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
typesafe-cla-validator All users have signed the CLA
Details

@mkurz mkurz deleted the mkurz:multipartFix branch Dec 14, 2018

marcospereira added a commit that referenced this pull request Dec 21, 2018

Handle multipart form upload with empty filename as BadPart (#8880)
* Handle multipart form upload with empty filename as BadPart

* Apply suggestions from code review

Co-Authored-By: mkurz <m.kurz@irregular.at>
@marcospereira

This comment has been minimized.

Copy link
Member

marcospereira commented Dec 21, 2018

Backport to 2.7.x: c2db60c

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