Module: wine Branch: master Commit: 3c5cb7f8dc451697f67017e28f35675c463c03a7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3c5cb7f8dc451697f67017e28f...
Author: Hans Leidekker hans@codeweavers.com Date: Wed Jun 24 14:17:53 2015 +0200
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 d6dd498..b598baa 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 2cf60b7..15d7fa2 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"))