mirror of
https://github.com/arduino-libraries/ArduinoHttpClient.git
synced 2025-06-07 07:42:01 +03:00
Adding port number to host header if != 80.
This commit is contained in:
parent
ea1618be0e
commit
8bb4f74fba
@ -176,7 +176,14 @@ int HttpClient::sendInitialHeaders(const char* aServerName, IPAddress aServerIP,
|
|||||||
// The host header, if required
|
// The host header, if required
|
||||||
if (aServerName)
|
if (aServerName)
|
||||||
{
|
{
|
||||||
sendHeader("Host", aServerName);
|
iClient->print("Host: ");
|
||||||
|
iClient->print(aServerName);
|
||||||
|
if (aPort != kHttpPort)
|
||||||
|
{
|
||||||
|
iClient->print(":");
|
||||||
|
iClient->print(aPort);
|
||||||
|
}
|
||||||
|
iClient->println();
|
||||||
}
|
}
|
||||||
// And user-agent string
|
// And user-agent string
|
||||||
iClient->print("User-Agent: ");
|
iClient->print("User-Agent: ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user