oohira / intercom-java

[DEPRECATED] A Java client library for Intercom web service
https://oohira.github.io/intercom-java/
MIT License
6 stars 5 forks source link

Don't set Content-Length property explicitly #6

Closed oohira closed 8 years ago

oohira commented 8 years ago

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.

oohira commented 8 years ago

@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.