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

Missing boundary for MultipartFormDataOutput #29794

Closed
piu130 opened this issue Dec 12, 2022 · 3 comments · Fixed by #29799
Closed

Missing boundary for MultipartFormDataOutput #29794

piu130 opened this issue Dec 12, 2022 · 3 comments · Fixed by #29799
Labels
area/resteasy-reactive kind/bug Something isn't working
Milestone

Comments

@piu130
Copy link
Contributor

piu130 commented Dec 12, 2022

Describe the bug

When returning a MultipartFormDataOutput, the MultipartMessageBodyWriter creates a random boundary (generateBoundary()). The boundary is never added to the Content-Type header.
When parsing the MultipartFormDataOutput response in the client it fails, because of the missing boundary.

Expected behavior

The response Content-Type header should look like Content-Type: multipart/form-data; boundary=--c57ab2f8-48ee-45f8-9268-34339e01cb2b when the boundary is --c57ab2f8-48ee-45f8-9268-34339e01cb2b.

Actual behavior

The response Content-Type header looks like Content-Type: multipart/form-data when the boundary is --c57ab2f8-48ee-45f8-9268-34339e01cb2b.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

17.0.5

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.14.0

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@piu130 piu130 added the kind/bug Something isn't working label Dec 12, 2022
@geoand
Copy link
Contributor

geoand commented Dec 12, 2022

Can provide a sample application that behaves the way you mention?

@geoand geoand added triage/needs-reproducer We are waiting for a reproducer. and removed triage/needs-triage labels Dec 12, 2022
@piu130
Copy link
Contributor Author

piu130 commented Dec 12, 2022

Hi @geoand , just found out that there are some missing details while creating the example.
I use quarkus-resteasy-reactive. It happens only with RestResponse, while using Response works as expected.
You can find the example here.
I only changed the GreetingResource and its test and removed the integration test from a new reactive project.

@Path("/hello")
public class GreetingResource {

    @GET
    @Produces(MediaType.MULTIPART_FORM_DATA)
    public RestResponse<MultipartFormDataOutput> hello() {
        var res = new MultipartFormDataOutput();
        res.addFormData("key", "entity", MediaType.TEXT_PLAIN_TYPE);
        return RestResponse.ok(res);
    }
}

@geoand
Copy link
Contributor

geoand commented Dec 12, 2022

Thanks for the reproducer. #29799 fixes the issue

@geoand geoand added area/resteasy-reactive and removed triage/needs-reproducer We are waiting for a reproducer. labels Dec 12, 2022
gsmet added a commit that referenced this issue Dec 13, 2022
Ensure that multipart response has a boundary when RestResponse is used
@quarkus-bot quarkus-bot bot added this to the 2.16 - main milestone Dec 13, 2022
@gsmet gsmet modified the milestones: 2.16 - main, 2.15.1.Final Dec 20, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resteasy-reactive kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants