Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Don't set Content-Length property explicitly#6

Merged
oohira merged 1 commit into
masterfrom
fix-content-length-bug
Jul 18, 2015
Merged

Don't set Content-Length property explicitly#6
oohira merged 1 commit into
masterfrom
fix-content-length-bug

Conversation

@oohira

@oohira oohira commented Jul 18, 2015

Copy link
Copy Markdown
Owner

As @maxkremer pointed out, there was a potential bug to set whole request contents to Content-Length property instead of the length.

Shouldnt this be String.valueOf(body).length() ? You're essentially putting all of the content in the content-length header

However, for good or bad, I found it does not have a impact for current users because HttpURLConnection.setRequestProperty() doesn't allow us to set Content-Length explicitly.

The wrong value (i.e. String.valueOf(body)) was just ignored. Of course, any other values are also ignored.

Previous code had a bug to set whole request contents instead of
the length. In addition, HttpURLConnection.setRequestProperty()
doesn't allow to set Content-Length because it is automatically
set in the library.
@oohira oohira added the bug label Jul 18, 2015
@oohira oohira self-assigned this Jul 18, 2015
oohira added a commit that referenced this pull request Jul 18, 2015
Don't set Content-Length property explicitly
@oohira oohira merged commit d96c247 into master Jul 18, 2015
@oohira oohira deleted the fix-content-length-bug branch July 18, 2015 13:47
@oohira

oohira commented Jul 19, 2015

Copy link
Copy Markdown
Owner Author

@maxkremer Thanks for your report. This is a terrible implementation. I fixed this bug and published v0.0.4 to Maven Central Repository. However, it is better for you to use the official Intercom v2 API library.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant