-
Notifications
You must be signed in to change notification settings - Fork 186
fix: Correctly calculate Content-Length when reading from a stream
#1277
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
Conversation
Pull Request Test Coverage Report for Build #4180Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build #4177Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build #4219Details
💛 - Coveralls |
| private static long getContentLengthFromAPIResponse(BoxAPIResponse response) { | ||
| long length = response.getContentLength(); | ||
| try { | ||
| if (length == -1 && response.getHeaders().containsKey(X_ORIGINAL_CONTENT_LENGTH)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code on line 93 checks for the size of the body, could you add one more checked please here
for the header response.getHeaders().containsKey(HttpHeaders.CONTENT_LENGTH) as well please. Basically,
- Check for response.getContentLength()
- Check for response.getHeaders().containsKey(HttpHeaders.CONTENT_LENGTH)
- Check for response.getHeaders().containsKey(X_ORIGINAL_CONTENT_LENGTH)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
0153e0c to
8d71339
Compare
365a523 to
6c742ca
Compare
6c742ca to
f08074a
Compare
No description provided.