Signed-off-by: Ziqing Hui zhui@codeweavers.com --- dlls/wininet/tests/http.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index 80b3160820b..137f1fff362 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -2063,6 +2063,32 @@ static void HttpHeaders_test(void) "header still present\n"); ok(GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, "got %lu\n", GetLastError());
+ /* Header with empty value should cause a failure */ + todo_wine + { + SetLastError(0xdeadbeef); + ok(!HttpAddRequestHeadersA(hRequest, "EmptyTest1:", -1, HTTP_ADDREQ_FLAG_ADD), "Empty header should not be added.\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error code %u.\n", GetLastError()); + + SetLastError(0xdeadbeef); + ok(!HttpAddRequestHeadersA(hRequest, "EmptyTest2:\r\n", -1, HTTP_ADDREQ_FLAG_ADD), "Empty header should not be added.\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Got unexpected error code %u.\n", GetLastError()); + + len = sizeof(buffer); + strcpy(buffer, "EmptyTest1"); + SetLastError(0xdeadbeef); + ok(!HttpQueryInfoA(hRequest, HTTP_QUERY_CUSTOM | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &len, NULL), + "Header with empty value is present.\n"); + ok(GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, "Got unexpected error code %u.\n", GetLastError()); + + len = sizeof(buffer); + strcpy(buffer, "EmptyTest2"); + SetLastError(0xdeadbeef); + ok(!HttpQueryInfoA(hRequest, HTTP_QUERY_CUSTOM | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &len, NULL), + "Header with empty value is present.\n"); + ok(GetLastError() == ERROR_HTTP_HEADER_NOT_FOUND, "Got unexpected error code %u.\n", GetLastError()); + } + ok(InternetCloseHandle(hRequest), "Close request handle failed\n"); done: ok(InternetCloseHandle(hConnect), "Close connect handle failed\n");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=112626
Your paranoid android.
=== w8adm (32 bit report) ===
wininet: http.c:697: Test failed: req_error = 12007 http.c:708: Test failed: expected status 11 (INTERNET_STATUS_NAME_RESOLVED) 1 times, received 0 times http.c:721: Test failed: expected status 30 (INTERNET_STATUS_SENDING_REQUEST) 1 times, received 0 times http.c:722: Test failed: expected status 31 (INTERNET_STATUS_REQUEST_SENT) 1 times, received 0 times http.c:723: Test failed: expected status 40 (INTERNET_STATUS_RECEIVING_RESPONSE) 1 times, received 0 times http.c:724: Test failed: expected status 41 (INTERNET_STATUS_RESPONSE_RECEIVED) 1 times, received 0 times http.c:733: Test failed: flags = 8, expected 0 http.c:747: Test failed: Expected any header character, got 0x00 http.c:774: Test failed: Expected 0x0000, got 7777 http.c:937: Test failed: Returned zero size in response to request complete http.c:376: Test failed: unexpected status 10 (INTERNET_STATUS_RESOLVING_NAME) http.c:376: Test failed: unexpected status 11 (INTERNET_STATUS_NAME_RESOLVED) http.c:718: Test failed: expected status 10 (INTERNET_STATUS_RESOLVING_NAME) 0 times, received 1 times http.c:719: Test failed: expected status 11 (INTERNET_STATUS_NAME_RESOLVED) 0 times, received 1 times