Commit 5132fb44 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

wininet: Fix retrieving raw headers.

parent 4e5c1bf6
......@@ -3080,6 +3080,20 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr)
} while (!strcmpW(status_code, szHundred)); /* ignore "100 Continue" responses */
/* Add status code */
HTTP_ProcessHeader(lpwhr, szStatus, status_code,
HTTP_ADDHDR_FLAG_REPLACE);
HeapFree(GetProcessHeap(),0,lpwhr->lpszVersion);
HeapFree(GetProcessHeap(),0,lpwhr->lpszStatusText);
lpwhr->lpszVersion= WININET_strdupW(buffer);
lpwhr->lpszStatusText = WININET_strdupW(status_text);
/* Restore the spaces */
*(status_code-1) = ' ';
*(status_text-1) = ' ';
/* regenerate raw headers */
while (cchRawHeaders + buflen + strlenW(szCrLf) > cchMaxRawHeaders)
{
......@@ -3092,15 +3106,6 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr)
cchRawHeaders += sizeof(szCrLf)/sizeof(szCrLf[0])-1;
lpszRawHeaders[cchRawHeaders] = '\0';
HTTP_ProcessHeader(lpwhr, szStatus, status_code,
HTTP_ADDHDR_FLAG_REPLACE);
HeapFree(GetProcessHeap(),0,lpwhr->lpszVersion);
HeapFree(GetProcessHeap(),0,lpwhr->lpszStatusText);
lpwhr->lpszVersion= WININET_strdupW(buffer);
lpwhr->lpszStatusText = WININET_strdupW(status_text);
/* Parse each response line */
do
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment