mirror of
https://github.com/reactos/wine.git
synced 2024-11-25 12:49:45 +00:00
wininet: Replace any existing cookie header.
This commit is contained in:
parent
fbc99515eb
commit
8ab00329dd
@ -3227,7 +3227,7 @@ static void HTTP_InsertCookies(LPWININETHTTPREQW lpwhr)
|
||||
InternetGetCookieW(lpszUrl, NULL, lpszCookies + cnt, &nCookieSize);
|
||||
strcatW(lpszCookies, szCrLf);
|
||||
|
||||
HTTP_HttpAddRequestHeadersW(lpwhr, lpszCookies, strlenW(lpszCookies), HTTP_ADDREQ_FLAG_ADD);
|
||||
HTTP_HttpAddRequestHeadersW(lpwhr, lpszCookies, strlenW(lpszCookies), HTTP_ADDREQ_FLAG_REPLACE);
|
||||
HeapFree(GetProcessHeap(), 0, lpszCookies);
|
||||
}
|
||||
}
|
||||
|
@ -1885,6 +1885,15 @@ static void test_cookie_header(int port)
|
||||
ok(!ret, "HttpQueryInfo succeeded\n");
|
||||
ok(error == ERROR_HTTP_HEADER_NOT_FOUND, "got %u expected ERROR_HTTP_HEADER_NOT_FOUND\n", error);
|
||||
|
||||
ret = HttpAddRequestHeaders(req, "Cookie: cookie=not biscuit\r\n", ~0u, HTTP_ADDREQ_FLAG_ADD);
|
||||
ok(ret, "HttpAddRequestHeaders failed: %u\n", GetLastError());
|
||||
|
||||
buffer[0] = 0;
|
||||
size = sizeof(buffer);
|
||||
ret = HttpQueryInfo(req, HTTP_QUERY_COOKIE | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, NULL);
|
||||
ok(ret, "HttpQueryInfo failed: %u\n", GetLastError());
|
||||
ok(!strcmp(buffer, "cookie=not biscuit"), "got '%s' expected \'cookie=not biscuit\'\n", buffer);
|
||||
|
||||
ret = HttpSendRequest(req, NULL, 0, NULL, 0);
|
||||
ok(ret, "HttpSendRequest failed: %u\n", GetLastError());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user