Skip to content

Commit

Permalink
include non-standard ports in Host: header
Browse files Browse the repository at this point in the history
  • Loading branch information
b-pass committed May 7, 2016
1 parent a2b82ed commit 74bd4f9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,13 @@ bool HTTPClient::sendHeader(const char * type)
header += "1";
}

header += String(F("\r\nHost: ")) + _host +
F("\r\nUser-Agent: ") + _userAgent +
header += String(F("\r\nHost: ")) + _host;
if (_port != 80 && _port != 443)
{
header += ':';
header += String(_port);
}
header += String(F("\r\nUser-Agent: ")) + _userAgent +
F("\r\nConnection: ");

if(_reuse) {
Expand Down

0 comments on commit 74bd4f9

Please sign in to comment.