mirror of
https://github.com/arduino-libraries/ArduinoHttpClient.git
synced 2025-04-19 21:22:15 +03:00
Merge pull request #1 from johnmckerrell/master
Fixing bug in HttpClient Host Header when the port isn't the default
This commit is contained in:
commit
fc72d823a7
@ -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