Skip to content

Commit

Permalink
Adding port number to host header if != 80.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmckerrell committed Sep 15, 2012
1 parent ea1618b commit 8bb4f74
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion HttpClient.cpp
Expand Up @@ -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: ");
Expand Down

0 comments on commit 8bb4f74

Please sign in to comment.