diff --git a/dlls/winhttp/cookie.c b/dlls/winhttp/cookie.c index b598baa369d..769055be210 100644 --- a/dlls/winhttp/cookie.c +++ b/dlls/winhttp/cookie.c @@ -121,7 +121,7 @@ static BOOL add_cookie( session_t *session, cookie_t *cookie, WCHAR *domain_name else if ((old_cookie = find_cookie( domain, path, cookie->name ))) delete_cookie( old_cookie ); cookie->path = strdupW( path ); - list_add_tail( &domain->cookies, &cookie->entry ); + list_add_head( &domain->cookies, &cookie->entry ); TRACE("domain %s path %s <- %s=%s\n", debugstr_w(domain_name), debugstr_w(cookie->path), debugstr_w(cookie->name), debugstr_w(cookie->value)); diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 15d7fa208e2..cdde30312c3 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2018,14 +2018,18 @@ static DWORD CALLBACK server_thread(LPVOID param) if (strstr(buffer, "GET /cookie3")) { 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); + broken(strstr(buffer, "Cookie: name=value2; name=value; NAME=value\r\n") != NULL)) + 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; 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); + broken(strstr(buffer, "Cookie: name=value; NAME=value\r\n") != NULL)) + send(c, okmsg, sizeof(okmsg) - 1, 0); + else + send(c, notokmsg, sizeof(notokmsg) - 1, 0); } else if (strstr(buffer, "GET /cookie")) {