ning/async-http-client

NettyAsyncHttpProvider.construct incorrectly creates default Content-Type for GET

jfager opened this issue · 2 comments

If you're issuing a GET request, you don't necessarily know or want to know what content type you're going to get back. Some servers treat content-type on GET as a request for a particular content-type, and will redirect you to the same url with the correct content-type that's available from that url.

The construct() method in NettyAsyncHttpProvider wrongly includes a default Content-Type of "text/html; charset=utf-8" for messages that don't have content, and as a result, is also incapable of correctly resolving the redirect it receives from servers that interpret Content-Type as described above. What should probably be in place instead is a default "Accept", for "/".

Agree. I did remove yesterday the default content type. I will work on the accept.