From 8bb4f74fba76f5543f3c203f2dea8596822e8db0 Mon Sep 17 00:00:00 2001 From: John McKerrell Date: Sat, 15 Sep 2012 10:59:09 +0100 Subject: [PATCH] Adding port number to host header if != 80. --- HttpClient.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/HttpClient.cpp b/HttpClient.cpp index 7d351e0..4e5e10a 100644 --- a/HttpClient.cpp +++ b/HttpClient.cpp @@ -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: ");