Skip to content
Merged
Changes from all 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
3 changes: 1 addition & 2 deletions libraries/HTTPClient/src/HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ void HTTPClient::addHeader(const String& name, const String& value, bool first,

if (replace) {
int headerStart = _headers.indexOf(headerLine);
if (headerStart != -1) {
if (headerStart != -1 && (headerStart == 0 || _headers[headerStart - 1] == '\n')) {
int headerEnd = _headers.indexOf('\n', headerStart);
_headers = _headers.substring(0, headerStart) + _headers.substring(headerEnd + 1);
}
Expand All @@ -924,7 +924,6 @@ void HTTPClient::addHeader(const String& name, const String& value, bool first,
_headers += headerLine;
}
}

}

void HTTPClient::collectHeaders(const char* headerKeys[], const size_t headerKeysCount)
Expand Down