wininet: Ignore missing status text in response headers.

This commit is contained in:
Jacek Caban 2013-07-19 12:02:18 +02:00 committed by Alexandre Julliard
parent 3d759a0c69
commit 10389b272d
2 changed files with 23 additions and 5 deletions

View File

@ -141,6 +141,8 @@ static const WCHAR szVia[] = { 'V','i','a',0 };
static const WCHAR szWarning[] = { 'W','a','r','n','i','n','g',0 };
static const WCHAR szWWW_Authenticate[] = { 'W','W','W','-','A','u','t','h','e','n','t','i','c','a','t','e',0 };
static const WCHAR emptyW[] = {0};
#define HTTP_REFERER szReferer
#define HTTP_ACCEPT szAccept
#define HTTP_USERAGENT szUser_Agent
@ -3874,6 +3876,8 @@ BOOL WINAPI HttpQueryInfoA(HINTERNET hHttpRequest, DWORD dwInfoLevel,
DWORD len;
WCHAR* bufferW;
TRACE("%p %x\n", hHttpRequest, dwInfoLevel);
if((dwInfoLevel & HTTP_QUERY_FLAG_NUMBER) ||
(dwInfoLevel & HTTP_QUERY_FLAG_SYSTEMTIME))
{
@ -5857,9 +5861,8 @@ static DWORD HTTP_GetResponseHeaders(http_request_t *request, INT *len)
/* split the status code from the status text */
status_text = strchrW( status_code, ' ' );
if( !status_text )
goto lend;
*status_text++=0;
if( status_text )
*status_text++=0;
request->status_code = atoiW(status_code);
@ -5891,11 +5894,12 @@ static DWORD HTTP_GetResponseHeaders(http_request_t *request, INT *len)
heap_free(request->statusText);
request->version = heap_strdupW(buffer);
request->statusText = heap_strdupW(status_text);
request->statusText = heap_strdupW(status_text ? status_text : emptyW);
/* Restore the spaces */
*(status_code-1) = ' ';
*(status_text-1) = ' ';
if (status_text)
*(status_text-1) = ' ';
/* Parse each response line */
do

View File

@ -3590,6 +3590,20 @@ static const http_status_test_t http_status_tests[] = {
"\r\nx",
404,
"Fail"
},
{
"HTTP/1.1 200\r\n"
"Content-Length: 1\r\n"
"\r\nx",
200,
""
},
{
"HTTP/1.1 410 \r\n"
"Content-Length: 1\r\n"
"\r\nx",
410,
""
}
};