From 0ac37810cad9fd0d2957505e792d9fd34ee44f8b Mon Sep 17 00:00:00 2001 From: scottfitzenrider Date: Wed, 25 May 2016 15:07:14 -0400 Subject: [PATCH] Update ESP8266HTTPClient.cpp The libb64 base64 library adds newlines to the base64 encoding of the encoded _base64Authorization String if the encoded string every 72 characters. This causes problems with the Authorization: Basic http header when the username and password are long. The change strips out newlines from _base64Authorization right before the header is sent. --- libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index 488607166..b593e1d5f 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -865,6 +865,7 @@ bool HTTPClient::sendHeader(const char * type) } if(_base64Authorization.length()) { + _base64Authorization.replace("\n", ""); header += F("Authorization: Basic "); header += _base64Authorization; header += "\r\n";