Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

Fix issue with submitting multipart data #33

Closed
wants to merge 8 commits into from

Conversation

avscj
Copy link

@avscj avscj commented Apr 27, 2017

Fixed by allowing multiple reads on the HttpRequest input stream.

Relates to issue #32

// the getInputStream method. Also tried reading one byte, works on
// first request, fails on all subsequent ones. Got no idea why at
// the moment
IOUtils.toString(usedStream, 'UTF-8')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is concerning to me because this ultimately will require all payloads to be read into memory for the duration of the request. This doesn't allow authors to efficiently pipe streams together, and can potentially cause large memory requirements, depending on the expected payload sizes.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bud.

Thanks for your review. This fix immediately unblocked me for using multipart requests in jersey, though I understand the problem. Will have a think on how to improve this

How did you get it to work for issue 21?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bud.

I think I found a better solution which involves overwriting the MultiPartReaderServerSide to support the Grails requests. My question is, you think it is ok if jersey-multipart will be added as a dependency into the grails-jaxrs-jersey1 plugin? I see no reason not to.

Will push the new fix soon

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking a look at these PR's. Did this ever get the multipart library added?

@avscj avscj closed this Oct 5, 2017
@avscj avscj deleted the grails-3.x branch October 5, 2017 21:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants