Fixes Cookie Case Sensitivity (#7112)

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
This commit is contained in:
Rodrigo Garcia 2022-08-16 07:07:24 -03:00 committed by GitHub
parent d9ac65f291
commit fe1d9e00d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1551,8 +1551,6 @@ void HTTPClient::setCookie(String date, String headerValue)
String value;
int pos1, pos2;
headerValue.toLowerCase();
struct tm tm;
strptime(date.c_str(), HTTP_TIME_PATTERN, &tm);
cookie.date = mktime(&tm);
@ -1567,6 +1565,9 @@ void HTTPClient::setCookie(String date, String headerValue)
return; // invalid cookie header
}
// only Cookie Attributes are case insensitive from this point on
headerValue.toLowerCase();
// expires
if (headerValue.indexOf("expires=") >= 0){
pos1 = headerValue.indexOf("expires=") + strlen("expires=");