wininet: Ignore missing status text in response headers.
This commit is contained in:
parent
3d759a0c69
commit
10389b272d
|
@ -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,8 +5861,7 @@ 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;
|
||||
if( status_text )
|
||||
*status_text++=0;
|
||||
|
||||
request->status_code = atoiW(status_code);
|
||||
|
@ -5891,10 +5894,11 @@ 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) = ' ';
|
||||
if (status_text)
|
||||
*(status_text-1) = ' ';
|
||||
|
||||
/* Parse each response line */
|
||||
|
|
|
@ -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,
|
||||
""
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue