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

Preserve the original filename when encoding a multipart/form in mixe… #9270

Conversation

Projects
None yet
4 participants
@vietj
Copy link
Contributor

commented Jun 23, 2019

…d mode.

Motivation:

The HttpPostRequestEncoder overwrites the original filename of file uploads sharing the same name encoded in mixed mode when it rewrites the multipart body header of the previous file. The original filename should be preserved instead.

Modifications:

Change the HttpPostRequestEncoder to reuse the correct filename when the encoder switches to mixed mode. The original test is incorrect and has been modified too, in addition it tests with an extra file upload since the current test was not testing the continuation of a mixed mode.

Result:

The HttpPostRequestEncoder will preserve the original filename of the first fileupload when switching to mixed mode

Fixes #9269.

Preserve the original filename when encoding a multipart/form in mixe…
…d mode.

Motivation:

The HttpPostRequestEncoder overwrites the original filename of file uploads sharing the same name encoded in mixed mode when it rewrites the multipart body header of the previous file. The original filename should be preserved instead.

Modifications:

Change the HttpPostRequestEncoder to reuse the correct filename when the encoder switches to mixed mode. The original test is incorrect and has been modified too, in addition it tests with an extra file upload since the current test was not testing the continuation of a mixed mode.

Result:

The HttpPostRequestEncoder will preserve the original filename of the first fileupload when switching to mixed mode
@netty-bot

This comment has been minimized.

Copy link

commented Jun 23, 2019

Can one of the admins verify this patch?

@normanmaurer

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

@netty-bot test this please

@fredericBregier

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

Correct for me

@normanmaurer normanmaurer added this to the 4.1.37.Final milestone Jun 24, 2019

@normanmaurer normanmaurer merged commit 1ad4728 into netty:4.1 Jun 24, 2019

3 checks passed

pull request validation (centos6-java11) Build finished.
Details
pull request validation (centos6-java12) Build finished.
Details
pull request validation (centos6-java8) Build finished.
Details

normanmaurer added a commit that referenced this pull request Jun 24, 2019

Preserve the original filename when encoding a multipart/form in mixe…
…d mode. (#9270)

Motivation:

The HttpPostRequestEncoder overwrites the original filename of file uploads sharing the same name encoded in mixed mode when it rewrites the multipart body header of the previous file. The original filename should be preserved instead.

Modifications:

Change the HttpPostRequestEncoder to reuse the correct filename when the encoder switches to mixed mode. The original test is incorrect and has been modified too, in addition it tests with an extra file upload since the current test was not testing the continuation of a mixed mode.

Result:

The HttpPostRequestEncoder will preserve the original filename of the first fileupload when switching to mixed mode
@normanmaurer

This comment has been minimized.

Copy link
Member

commented Jun 24, 2019

@vietj thanks a lot!

@vietj

This comment has been minimized.

Copy link
Contributor Author

commented Jun 24, 2019

you are welcome, @normanmaurer happy to contribute and give back to community even if that's a small change like this :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.