wininet: Use stored server name in HTTP_InsertCookies.

This commit is contained in:
Jacek Caban 2014-07-14 15:21:11 +02:00 committed by Alexandre Julliard
parent 8980a6fa5c
commit ffec675b4f
1 changed files with 2 additions and 7 deletions

View File

@ -4177,16 +4177,11 @@ static LPWSTR HTTP_build_req( LPCWSTR *list, int len )
static void HTTP_InsertCookies(http_request_t *request) static void HTTP_InsertCookies(http_request_t *request)
{ {
DWORD cookie_size, size, cnt = 0; DWORD cookie_size, size, cnt = 0;
HTTPHEADERW *host;
WCHAR *cookies; WCHAR *cookies;
static const WCHAR cookieW[] = {'C','o','o','k','i','e',':',' ',0}; static const WCHAR cookieW[] = {'C','o','o','k','i','e',':',' ',0};
host = HTTP_GetHeader(request, hostW); if(get_cookie(request->server->name, request->path, NULL, &cookie_size, INTERNET_COOKIE_HTTPONLY) != ERROR_SUCCESS)
if(!host)
return;
if(get_cookie(host->lpszValue, request->path, NULL, &cookie_size, INTERNET_COOKIE_HTTPONLY) != ERROR_SUCCESS)
return; return;
size = sizeof(cookieW) + cookie_size * sizeof(WCHAR) + sizeof(szCrLf); size = sizeof(cookieW) + cookie_size * sizeof(WCHAR) + sizeof(szCrLf);
@ -4194,7 +4189,7 @@ static void HTTP_InsertCookies(http_request_t *request)
return; return;
cnt += sprintfW(cookies, cookieW); cnt += sprintfW(cookies, cookieW);
get_cookie(host->lpszValue, request->path, cookies+cnt, &cookie_size, INTERNET_COOKIE_HTTPONLY); get_cookie(request->server->name, request->path, cookies+cnt, &cookie_size, INTERNET_COOKIE_HTTPONLY);
strcatW(cookies, szCrLf); strcatW(cookies, szCrLf);
HTTP_HttpAddRequestHeadersW(request, cookies, strlenW(cookies), HTTP_ADDREQ_FLAG_REPLACE); HTTP_HttpAddRequestHeadersW(request, cookies, strlenW(cookies), HTTP_ADDREQ_FLAG_REPLACE);