From 2aa3d697a3d772e37a8ff59eb3e538320b73c305 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 3 May 2012 12:20:38 +0200 Subject: [PATCH] wininet: Set status code OK for responses without headers. --- dlls/wininet/http.c | 1 + dlls/wininet/tests/http.c | 9 ++------- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 84b83f267f7..90cb2867cf0 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -5725,6 +5725,7 @@ static INT HTTP_GetResponseHeaders(http_request_t *request, BOOL clear) heap_free(request->version); heap_free(request->statusText); + request->status_code = HTTP_STATUS_OK; request->version = heap_strdupW(g_szHttp1_0); request->statusText = heap_strdupW(szOK); diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 7e21a22de6b..7984f160557 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -2426,7 +2426,7 @@ static void test_invalid_response_headers(int port) static void test_response_without_headers(int port) { HINTERNET hi, hc, hr; - DWORD r, count, size, status; + DWORD r, count, size; char buffer[1024]; SetLastError(0xdeadbeef); @@ -2453,12 +2453,7 @@ static void test_response_without_headers(int port) todo_wine ok(count == sizeof page1 - 1, "count was wrong\n"); todo_wine ok(!memcmp(buffer, page1, sizeof page1), "http data wrong\n"); - status = 0; - size = sizeof(status); - SetLastError(0xdeadbeef); - r = HttpQueryInfo(hr, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &status, &size, NULL ); - ok(r, "HttpQueryInfo failed %u\n", GetLastError()); - todo_wine ok(status == 200, "expected status 200 got %u\n", status); + test_status_code(hr, 200); buffer[0] = 0; size = sizeof(buffer);