Skip to content

Commit 0ac3781

Browse files
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.
1 parent 5313c56 commit 0ac3781

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,7 @@ bool HTTPClient::sendHeader(const char * type)
865865
}
866866

867867
if(_base64Authorization.length()) {
868+
_base64Authorization.replace("\n", "");
868869
header += F("Authorization: Basic ");
869870
header += _base64Authorization;
870871
header += "\r\n";

0 commit comments

Comments
 (0)