Skip to content

Commit

Permalink
HTTPClient - Fix case sensitiveness for header keys (#8713)
Browse files Browse the repository at this point in the history
  • Loading branch information
me-no-dev authored Oct 6, 2023
1 parent 352af86 commit 93a4501
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/HTTPClient/src/HTTPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ void HTTPClient::collectHeaders(const char* headerKeys[], const size_t headerKey
String HTTPClient::header(const char* name)
{
for(size_t i = 0; i < _headerKeysCount; ++i) {
if(_currentHeaders[i].key == name) {
if(_currentHeaders[i].key.equalsIgnoreCase(name)) {
return _currentHeaders[i].value;
}
}
Expand Down Expand Up @@ -1112,7 +1112,7 @@ int HTTPClient::headers()
bool HTTPClient::hasHeader(const char* name)
{
for(size_t i = 0; i < _headerKeysCount; ++i) {
if((_currentHeaders[i].key == name) && (_currentHeaders[i].value.length() > 0)) {
if((_currentHeaders[i].key.equalsIgnoreCase(name)) && (_currentHeaders[i].value.length() > 0)) {
return true;
}
}
Expand Down

0 comments on commit 93a4501

Please sign in to comment.