Skip to content

Commit 7fc7acf

Browse files
committed
AsyncHttpRequest: do not set host when there is none.
Change-Id: I20c72374f7aad7d10871cab0e82cbee5972fc2c9
1 parent 27d5b20 commit 7fc7acf

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

AndroidAsync/src/com/koushikdutta/async/http/AsyncHttpRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ public static void setDefaultHeaders(RawHeaders ret, URI uri) {
9898
String host = uri.getHost();
9999
if (uri.getPort() != -1)
100100
host = host + ":" + uri.getPort();
101-
ret.set("Host", host);
101+
if (host != null)
102+
ret.set("Host", host);
102103
}
103104
ret.set("User-Agent", getDefaultUserAgent());
104105
ret.set("Accept-Encoding", "gzip, deflate");

0 commit comments

Comments
 (0)