Skip to content

Commit 3839f07

Browse files
HTTPClient - Fix case sensitivity for header keys (#2185)
From espressif/arduino-esp32#8713
1 parent 2043623 commit 3839f07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/HTTPClient/src/HTTPClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ void HTTPClient::collectHeaders(const char* headerKeys[], const size_t headerKey
955955

956956
String HTTPClient::header(const char* name) {
957957
for (size_t i = 0; i < _headerKeysCount; ++i) {
958-
if (_currentHeaders[i].key == name) {
958+
if (_currentHeaders[i].key.equalsIgnoreCase(name)) {
959959
return _currentHeaders[i].value;
960960
}
961961
}
@@ -982,7 +982,7 @@ int HTTPClient::headers() {
982982

983983
bool HTTPClient::hasHeader(const char* name) {
984984
for (size_t i = 0; i < _headerKeysCount; ++i) {
985-
if ((_currentHeaders[i].key == name) && (_currentHeaders[i].value.length() > 0)) {
985+
if ((_currentHeaders[i].key.equalsIgnoreCase(name)) && (_currentHeaders[i].value.length() > 0)) {
986986
return true;
987987
}
988988
}

0 commit comments

Comments
 (0)