We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2b82ed commit 74bd4f9Copy full SHA for 74bd4f9
libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
@@ -844,8 +844,13 @@ bool HTTPClient::sendHeader(const char * type)
844
header += "1";
845
}
846
847
- header += String(F("\r\nHost: ")) + _host +
848
- F("\r\nUser-Agent: ") + _userAgent +
+ header += String(F("\r\nHost: ")) + _host;
+ if (_port != 80 && _port != 443)
849
+ {
850
+ header += ':';
851
+ header += String(_port);
852
+ }
853
+ header += String(F("\r\nUser-Agent: ")) + _userAgent +
854
F("\r\nConnection: ");
855
856
if(_reuse) {
0 commit comments