From 3c5cb7f8dc451697f67017e28f35675c463c03a7 Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Wed, 24 Jun 2015 14:17:53 +0200 Subject: [PATCH] winhttp: Perform a case sensitive match on cookie names. --- dlls/winhttp/cookie.c | 2 +- dlls/winhttp/tests/winhttp.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/winhttp/cookie.c b/dlls/winhttp/cookie.c index d6dd4981469..b598baa369d 100644 --- a/dlls/winhttp/cookie.c +++ b/dlls/winhttp/cookie.c @@ -54,7 +54,7 @@ static cookie_t *find_cookie( domain_t *domain, const WCHAR *path, const WCHAR * LIST_FOR_EACH( item, &domain->cookies ) { cookie = LIST_ENTRY( item, cookie_t, entry ); - if (!strcmpW( cookie->path, path ) && !strcmpiW( cookie->name, name )) + if (!strcmpW( cookie->path, path ) && !strcmpW( cookie->name, name )) { TRACE("found %s=%s\n", debugstr_w(cookie->name), debugstr_w(cookie->value)); return cookie; diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 2cf60b70650..15d7fa208e2 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -1893,6 +1893,7 @@ static const char notokmsg[] = static const char cookiemsg[] = "HTTP/1.1 200 OK\r\n" "Set-Cookie: name = value \r\n" +"Set-Cookie: NAME = value \r\n" "\r\n"; static const char nocontentmsg[] = @@ -2016,12 +2017,14 @@ static DWORD CALLBACK server_thread(LPVOID param) } if (strstr(buffer, "GET /cookie3")) { - if (strstr(buffer, "Cookie: name=value2; name=value\r\n")) send(c, okmsg, sizeof(okmsg) - 1, 0); + if (strstr(buffer, "Cookie: name=value2; NAME=value; name=value\r\n") || + strstr(buffer, "Cookie: name=value2; name=value; NAME=value\r\n")) send(c, okmsg, sizeof(okmsg) - 1, 0); else send(c, notokmsg, sizeof(notokmsg) - 1, 0); } if (strstr(buffer, "GET /cookie2")) { - if (strstr(buffer, "Cookie: name=value\r\n")) send(c, okmsg, sizeof(okmsg) - 1, 0); + if (strstr(buffer, "Cookie: NAME=value; name=value\r\n") || + strstr(buffer, "Cookie: name=value; NAME=value\r\n")) send(c, okmsg, sizeof(okmsg) - 1, 0); else send(c, notokmsg, sizeof(notokmsg) - 1, 0); } else if (strstr(buffer, "GET /cookie")) -- 2.11.4.GIT