Skip to content

HttpPostRequestEncoder will overwrite the original filename when switching to mixed mode #9269

@vietj

Description

@vietj

Expected behavior

The HttpPostRequestEncoder preserves the original filename of file uploads sharing the same name encoded in mixed mode.

Actual behavior

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.

Steps to reproduce

Use an HttpPostRequestEncoder with multipart and the default mode and add several body file upload using the same name and different filenames. The test suite contains already such test but the test is wrong and will not check correctly that the original filename is preserved.

Minimal yet complete reproducer code (or URL to code)

Update HttpPostRequestEncoderTest#testMultiFileUploadInMixedMode and change the first occurence of filename="file-02.txt"" by filename="file-01.txt""

Netty version

All ?

JVM version (e.g. java -version)

N/A

OS version (e.g. uname -a)

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions