Skip to content

Update to ESP8266HTTPClient.cpp for no Content-Length #7691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 20, 2020
7 changes: 7 additions & 0 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,13 @@ int HTTPClient::writeToStream(Stream * stream)
if(len > 0) {
ret = writeToStreamDataBlock(stream, len);

// have we an error?
if(ret < 0) {
return returnError(ret);
}
} else if(len == -1 && _client->available() > 0) {
ret = writeToStreamDataBlock(stream, _client->available() > 0);

// have we an error?
if(ret < 0) {
return returnError(ret);
Expand Down