Skip to content

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

Merged
normanmaurer merged 1 commit into
netty:4.1from
vietj:http-post-request-encoder-should-preserve-filename-in-mixed-mode
Jun 24, 2019
Merged

normanmaurer merged 1 commit into
netty:4.1from
vietj:http-post-request-encoder-should-preserve-filename-in-mixed-mode

Conversation

@vietj

@vietj vietj commented Jun 23, 2019 •

Copy link
Copy Markdown
Contributor

…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.

…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

Copy link
Copy Markdown

Can one of the admins verify this patch?

@normanmaurer

Copy link
Copy Markdown
Member

@netty-bot test this please

@fredericBregier

Copy link
Copy Markdown
Member

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
normanmaurer pushed a commit that referenced this pull request Jun 24, 2019
…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

Copy link
Copy Markdown
Member

@vietj thanks a lot!

@vietj

vietj commented Jun 24, 2019

Copy link
Copy Markdown
Contributor Author

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HttpPostRequestEncoder will overwrite the original filename when switching to mixed mode

4 participants