Skip to content

Multipart messages with empty parts are not correctly parsed in WebFlux #33874

Closed as not planned
@KrisDaCoder

Description

@KrisDaCoder

In my application spring boot webflux application I have an upload use case which requires the upload of 1 and more empty files. The upload endpoint is pretty simple in itself and goes like this:

public Mono<ResponseEntity<ResponseDTO>> upload(@RequestPart("files") Flux<FilePart> fileParts) {
    // fileParts.flatMap(filePart -> will only contain the last empty file always if more than one empty file is uploaded)
}

The problem is that if more than 1 empty files are uploaded, then only the last one is considered.

This issue started when upgrading from spring boot 2.7.18 to 3.3.5.

I saw a similar issue to this #30953 which has already been closed but I'm still having something similar. I tried though to reproduce it using the webTestClient in an automated test but to no avail. Maybe this explains #30953.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions