Skip to content

Commit fe1d9e0

Browse files
Fixes Cookie Case Sensitivity (espressif#7112)
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
1 parent d9ac65f commit fe1d9e0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

libraries/HTTPClient/src/HTTPClient.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1551,8 +1551,6 @@ void HTTPClient::setCookie(String date, String headerValue)
15511551
String value;
15521552
int pos1, pos2;
15531553

1554-
headerValue.toLowerCase();
1555-
15561554
struct tm tm;
15571555
strptime(date.c_str(), HTTP_TIME_PATTERN, &tm);
15581556
cookie.date = mktime(&tm);
@@ -1567,6 +1565,9 @@ void HTTPClient::setCookie(String date, String headerValue)
15671565
return; // invalid cookie header
15681566
}
15691567

1568+
// only Cookie Attributes are case insensitive from this point on
1569+
headerValue.toLowerCase();
1570+
15701571
// expires
15711572
if (headerValue.indexOf("expires=") >= 0){
15721573
pos1 = headerValue.indexOf("expires=") + strlen("expires=");

0 commit comments

Comments
 (0)