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

InputStream should not be closed prematurely #690

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

faucct
Copy link

@faucct faucct commented Aug 26, 2020

No description provided.

@coheigea
Copy link
Contributor

coheigea commented Nov 2, 2020

What's the context behind this pull request? Can you create a JIRA describing the problem?

@faucct
Copy link
Author

faucct commented Nov 2, 2020

I don't think I remember the whole context, but the problem was that in case of MediaType.MULTIPART_FORM_DATA_TYPE the message body was also a stream and was being consumed twice. When debugging this issue I have found this hack and decided to plug in there.

Copy link
Contributor

@andymc12 andymc12 left a comment

Choose a reason for hiding this comment

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

I think this change makes sense.

I think we put in the first isCompatible/copyAndGetEntityStream code in place to allow other JAX-RS interceptors to read the form data so that we could populate @FormParam parameters, but still leave the entity stream in a state that could be processed by user-provided entity providers and interceptors. HTH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants