[improvement] FeatureFlag to make Response the return type for binary Jersey Responses#37
Merged
Merged
Conversation
Contributor
|
I think this is an acceptable short-term solution - we'll probably want to follow up with a more first-class type for java servers so that people can actually specify these content lengths without this hack, but happy to unblock things for now! |
iamdanfox
approved these changes
Jul 16, 2018
carterkozak
pushed a commit
to carterkozak/conjure-java
that referenced
this pull request
Dec 24, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR
Currently binary response types are rendered as
StreamingOutput. There's a bug in Jersey which causes a failure part way through streaming back that response to appear as a successful response to the client: eclipse-ee4j/jersey#3850After this PR
By rendering
Responseas the return type we are still able to useStreamingOutputas the body of the response, but we are also able to include theContent-Lengthheader when we know the size of the response. Including the content length allows clients to determine there was an error, even when the stream appeared to have been closed successfully.