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

MimeParser.offer needs to ignore empty buffers #6828

Closed
romain-grecourt opened this issue May 15, 2023 · 0 comments · Fixed by #6851
Closed

MimeParser.offer needs to ignore empty buffers #6828

romain-grecourt opened this issue May 15, 2023 · 0 comments · Fixed by #6851
Assignees
Labels
2.x Issues for 2.x version branch bug Something isn't working media-support Media type processing in SE SE
Milestone

Comments

@romain-grecourt
Copy link
Contributor

romain-grecourt commented May 15, 2023

Environment Details

  • Helidon Version: 2.6.0
  • Helidon SE

When processing a multipart server payload from a client response, Netty's LastHttpContent empty buffer is not expected and triggers a MimeParserException Invalid state: END_MESSAGE.

Reproducer:

MultiPartSupport multiPartSupport = MultiPartSupport.create();
WebClient webClient = WebClient.builder()
                               .baseUri("http://localhost:8080")
                               .addMediaSupport(multiPartSupport)
                               .build();

WebServer.builder()
         .port(8080)
         .addMediaSupport(multiPartSupport)
         .addRouting(Routing.builder()
                            .get("/test", (req, res) ->
                                    res.send(WriteableMultiPart.builder()
                                                               .bodyPart("foo", "bar")
                                                               .bodyPart("bob", "alice")
                                                               .build()))
                            .get("/", (req, res) ->
                                    webClient.get()
                                             .path("test")
                                             .accept(MediaType.MULTIPART_FORM_DATA)
                                             .submit()
                                             .flatMap(response -> response.content().asStream(ReadableBodyPart.class))
                                             .forEach(ReadableBodyPart::drain)
                                             .onError(req::next)
                                             .forSingle(res::send))
                            .build())
         .build()
         .start();
@romain-grecourt romain-grecourt added bug Something isn't working SE media-support Media type processing in SE 3.x Issues for 3.x version branch labels May 15, 2023
@romain-grecourt romain-grecourt added this to the 2.6.1 milestone May 18, 2023
@romain-grecourt romain-grecourt added 2.x Issues for 2.x version branch and removed 3.x Issues for 3.x version branch labels May 18, 2023
romain-grecourt added a commit to romain-grecourt/helidon that referenced this issue May 18, 2023
@romain-grecourt romain-grecourt linked a pull request May 18, 2023 that will close this issue
@m0mus m0mus closed this as completed May 22, 2023
romain-grecourt added a commit to romain-grecourt/helidon that referenced this issue May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues for 2.x version branch bug Something isn't working media-support Media type processing in SE SE
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants