Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,7 @@ int HTTPClient::sendRequest(const char * type, uint8_t * payload, size_t size)
return returnError(HTTPC_ERROR_CONNECTION_REFUSED);
}

if(payload && size > 0) {
addHeader(F("Content-Length"), String(size));
}
addHeader(F("Content-Length"), String(payload && size > 0 ? size : 0));

// send Header
if(!sendHeader(type)) {
Expand Down