Skip to content

Commit 8bb4f74

Browse files
committed
Adding port number to host header if != 80.
1 parent ea1618b commit 8bb4f74

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

HttpClient.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,14 @@ int HttpClient::sendInitialHeaders(const char* aServerName, IPAddress aServerIP,
176176
// The host header, if required
177177
if (aServerName)
178178
{
179-
sendHeader("Host", aServerName);
179+
iClient->print("Host: ");
180+
iClient->print(aServerName);
181+
if (aPort != kHttpPort)
182+
{
183+
iClient->print(":");
184+
iClient->print(aPort);
185+
}
186+
iClient->println();
180187
}
181188
// And user-agent string
182189
iClient->print("User-Agent: ");

0 commit comments

Comments
 (0)