1
0
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:
John McKerrell 2012-09-15 10:59:09 +01:00
parent ea1618be0e
commit 8bb4f74fba

View File

@ -176,7 +176,14 @@ int HttpClient::sendInitialHeaders(const char* aServerName, IPAddress aServerIP,
// The host header, if required
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
iClient->print("User-Agent: ");