diff --git a/README.md b/README.md index 07441096..18b15523 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,9 @@ Wine. All those differences are also documented on the Included bug fixes and improvements ----------------------------------- -**Bug fixes and features included in the next upcoming release [15]:** +**Bug fixes and features included in the next upcoming release [16]:** +* Add HTTP Host header in HttpSendRequest instead of HttpOpenRequest ([Wine Bug #28911](https://bugs.winehq.org/show_bug.cgi?id=28911)) * Add IEnumString stub interface for ACLShellSource ([Wine Bug #18019](https://bugs.winehq.org/show_bug.cgi?id=18019)) * Add implementation for shlwapi.AssocGetPerceivedType * Add stub for atl80.AtlIPersistPropertyBag_Save ([Wine Bug #33888](https://bugs.winehq.org/show_bug.cgi?id=33888)) diff --git a/debian/changelog b/debian/changelog index 0fff59d0..00fe3192 100644 --- a/debian/changelog +++ b/debian/changelog @@ -38,6 +38,8 @@ wine-staging (1.7.43) UNRELEASED; urgency=low * Added patch to fix memory leak in wininet.HTTP_InsertCookies. * Added patches for additional tests of wininet cookie/header/authentication handling, in preparation of various cleanup patches. + * Added patch to add HTTP Host header in HttpSendRequest instead of + HttpOpenRequest. * Removed patch to use lockfree implementation for FD cache (accepted upstream). * Removed patch to properly handle closing sockets during a select call diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index 797f6f45..e5928c8f 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -5505,17 +5505,30 @@ fi # Patchset wininet-Cleanup # | +# | This patchset fixes the following Wine bugs: +# | * [#28911] Add HTTP Host header in HttpSendRequest instead of HttpOpenRequest +# | # | Modified files: -# | * dlls/wininet/tests/http.c +# | * dlls/wininet/http.c, dlls/wininet/tests/http.c # | if test "$enable_wininet_Cleanup" -eq 1; then patch_apply wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch patch_apply wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch patch_apply wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch + patch_apply wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch + patch_apply wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch + patch_apply wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch + patch_apply wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch + patch_apply wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch ( echo '+ { "Michael Müller", "wininet/tests: Add more tests for cookies.", 1 },'; echo '+ { "Michael Müller", "wininet/tests: Add tests for overriding host header.", 1 },'; echo '+ { "Michael Müller", "wininet/tests: Test auth credential reusage with host override.", 1 },'; + echo '+ { "Michael Müller", "wininet/tests: Check cookie behaviour when overriding host.", 1 },'; + echo '+ { "Michael Müller", "wininet: Use request->server->name when processing cookies instead of Host header field.", 1 },'; + echo '+ { "Michael Müller", "wininet: Delay setting the http host header.", 1 },'; + echo '+ { "Michael Müller", "wininet: Use request->server->canon_host_port in authentication process.", 1 },'; + echo '+ { "Michael Müller", "wininet: Use request->server->canon_host_port when querying for INTERNET_OPTION_URL.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch b/patches/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch index 5c890a17..72fcbe79 100644 --- a/patches/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch +++ b/patches/wininet-Cleanup/0001-wininet-tests-Add-more-tests-for-cookies.patch @@ -1,4 +1,4 @@ -From abee6ead437c5bb951ef80093c464712e41ef270 Mon Sep 17 00:00:00 2001 +From eb300f805c1d7009d60b4ad382e6d9af2669c453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 15 May 2015 20:37:19 +0200 Subject: wininet/tests: Add more tests for cookies. diff --git a/patches/wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch b/patches/wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch index 0f0ab877..20da937f 100644 --- a/patches/wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch +++ b/patches/wininet-Cleanup/0002-wininet-tests-Add-tests-for-overriding-host-header.patch @@ -1,4 +1,4 @@ -From e6ff4bc0e13f286c8c64fbcbb0835e275286464f Mon Sep 17 00:00:00 2001 +From 72b7eaf33df2d8460e8ed6659fe82e4e2e7cee90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 15 May 2015 21:07:19 +0200 Subject: wininet/tests: Add tests for overriding host header. diff --git a/patches/wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch b/patches/wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch index a68d19c0..ad6dd71e 100644 --- a/patches/wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch +++ b/patches/wininet-Cleanup/0003-wininet-tests-Test-auth-credential-reusage-with-host.patch @@ -1,4 +1,4 @@ -From a380fe97276133844c8321d14bf37563ce01e8b1 Mon Sep 17 00:00:00 2001 +From 92d5f7bb41006cbe61ef3226abdb36bbb13d26dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Fri, 15 May 2015 21:18:37 +0200 Subject: wininet/tests: Test auth credential reusage with host override. diff --git a/patches/wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch b/patches/wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch new file mode 100644 index 00000000..bffc9264 --- /dev/null +++ b/patches/wininet-Cleanup/0004-wininet-tests-Check-cookie-behaviour-when-overriding.patch @@ -0,0 +1,146 @@ +From 2b5e76bf213aaf2530b451e7f02bc848a1e88e49 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Fri, 15 May 2015 23:09:20 +0200 +Subject: wininet/tests: Check cookie behaviour when overriding host. + +--- + dlls/wininet/tests/http.c | 101 +++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 100 insertions(+), 1 deletion(-) + +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 4c515b7..165a76e 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -1982,6 +1982,14 @@ static const char okmsg_cookie_path[] = + "Set-Cookie: subcookie2=data; path=/test_cookie_set_path\r\n" + "\r\n"; + ++static const char okmsg_cookie[] = ++"HTTP/1.1 200 OK\r\n" ++"Date: Mon, 01 Dec 2008 13:44:34 GMT\r\n" ++"Server: winetest\r\n" ++"Content-Length: 0\r\n" ++"Set-Cookie: testcookie=testvalue\r\n" ++"\r\n"; ++ + static const char notokmsg[] = + "HTTP/1.1 400 Bad Request\r\n" + "Server: winetest\r\n" +@@ -2371,6 +2379,25 @@ static DWORD CALLBACK server_thread(LPVOID param) + else + send(c, notokmsg, sizeof notokmsg-1, 0); + } ++ if (strstr(buffer, "/test_cookie_set_host_override")) ++ { ++ send(c, okmsg_cookie, sizeof okmsg_cookie-1, 0); ++ } ++ if (strstr(buffer, "/test_cookie_check_host_override")) ++ { ++ if (strstr(buffer, "Cookie:") && strstr(buffer, "testcookie=testvalue")) ++ send(c, okmsg, sizeof okmsg-1, 0); ++ else ++ send(c, notokmsg, sizeof notokmsg-1, 0); ++ } ++ if (strstr(buffer, "/test_cookie_check_different_host")) ++ { ++ if (!strstr(buffer, "foo") && ++ strstr(buffer, "cookie=biscuit")) ++ send(c, okmsg, sizeof okmsg-1, 0); ++ else ++ send(c, notokmsg, sizeof notokmsg-1, 0); ++ } + if (strstr(buffer, "/test_host_override")) + { + if (strstr(buffer, host_header_override)) +@@ -3082,6 +3109,76 @@ static void test_header_override(int port) + test_status_code_todo(req, 400); + InternetCloseHandle(req); + ++ InternetSetCookieA("http://localhost", "cookie", "biscuit"); ++ ++ req = HttpOpenRequestA(con, NULL, "/testC", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code(req, 200); ++ InternetCloseHandle(req); ++ ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_set_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code(req, 200); ++ InternetCloseHandle(req); ++ ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code_todo(req, 200); ++ InternetCloseHandle(req); ++ ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code_todo(req, 200); ++ InternetCloseHandle(req); ++ ++ InternetSetCookieA("http://test.local", "foo", "bar"); ++ ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code(req, 200); ++ InternetCloseHandle(req); ++ ++ req = HttpOpenRequestA(con, NULL, "/test_cookie_check_different_host", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); ++ ok(req != NULL, "HttpOpenRequest failed\n"); ++ ++ ret = HttpAddRequestHeadersA(req, host_header_override, ~0u, HTTP_ADDREQ_FLAG_ADD); ++ ok(ret, "HttpAddRequestHeaders failed\n"); ++ ++ ret = HttpSendRequestA(req, NULL, 0, NULL, 0); ++ ok(ret, "HttpSendRequest failed\n"); ++ ++ test_status_code(req, 200); ++ InternetCloseHandle(req); ++ + InternetCloseHandle( con ); + InternetCloseHandle( ses ); + +@@ -4453,8 +4550,10 @@ static void test_request_content_length(int port) + con = InternetConnectA(ses, "localhost", port, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0); + ok(con != NULL, "InternetConnect failed\n"); + ++ /* On XP there is a weird bug that the following tests fail if certain cookies ++ * are set. We workaround this problem by passing INTERNET_FLAG_NO_COOKIES as flag. */ + req = HttpOpenRequestA(con, "POST", "/test_request_content_length", NULL, NULL, NULL, +- INTERNET_FLAG_KEEP_CONNECTION, 0); ++ INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_NO_COOKIES, 0); + ok(req != NULL, "HttpOpenRequest failed\n"); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); +-- +2.4.0 + diff --git a/patches/wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch b/patches/wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch new file mode 100644 index 00000000..2ce9e9f7 --- /dev/null +++ b/patches/wininet-Cleanup/0005-wininet-Use-request-server-name-when-processing-cook.patch @@ -0,0 +1,45 @@ +From 73deec220b498f3a3ac6bf0674b9e0550f0aebdc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 01:34:22 +0200 +Subject: wininet: Use request->server->name when processing cookies instead of + Host header field. + +--- + dlls/wininet/http.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index cd2cdcf..51ca427 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -765,7 +765,6 @@ static void HTTP_ProcessCookies( http_request_t *request ) + + while((HeaderIndex = HTTP_GetCustomHeaderIndex(request, szSet_Cookie, numCookies++, FALSE)) != -1) + { +- HTTPHEADERW *host; + const WCHAR *data; + WCHAR *name; + +@@ -774,10 +773,6 @@ static void HTTP_ProcessCookies( http_request_t *request ) + if (!setCookieHeader->lpszValue) + continue; + +- host = HTTP_GetHeader(request, hostW); +- if(!host) +- continue; +- + data = strchrW(setCookieHeader->lpszValue, '='); + if(!data) + continue; +@@ -787,7 +782,7 @@ static void HTTP_ProcessCookies( http_request_t *request ) + continue; + + data++; +- set_cookie(host->lpszValue, request->path, name, data, INTERNET_COOKIE_HTTPONLY); ++ set_cookie(request->server->name, request->path, name, data, INTERNET_COOKIE_HTTPONLY); + heap_free(name); + } + +-- +2.4.0 + diff --git a/patches/wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch b/patches/wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch new file mode 100644 index 00000000..d3f456ba --- /dev/null +++ b/patches/wininet-Cleanup/0006-wininet-Delay-setting-the-http-host-header.patch @@ -0,0 +1,138 @@ +From c905bda4bbedf7cd8612d5f24ff9a6dd4c9ede90 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 01:39:33 +0200 +Subject: wininet: Delay setting the http host header. + +This change temporarly breaks two other tests which were only +working by pure accident before. +--- + dlls/wininet/http.c | 28 ++++++++++++++++++---------- + dlls/wininet/tests/http.c | 10 +++++----- + 2 files changed, 23 insertions(+), 15 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index 51ca427..42e2c30 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -376,6 +376,7 @@ static WCHAR *get_host_header( http_request_t *req ) + + EnterCriticalSection( &req->headers_section ); + if ((header = HTTP_GetHeader( req, hostW ))) ret = heap_strdupW( header->lpszValue ); ++ else ret = heap_strdupW( req->server->canon_host_port ); + LeaveCriticalSection( &req->headers_section ); + return ret; + } +@@ -1878,20 +1879,21 @@ static BOOL HTTP_GetRequestURL(http_request_t *req, LPWSTR buf) + static const WCHAR https[] = { 'h','t','t','p','s',':','/','/',0 }; + static const WCHAR slash[] = { '/',0 }; + LPHTTPHEADERW host_header; ++ const WCHAR *host; + LPCWSTR scheme; + +- host_header = HTTP_GetHeader(req, hostW); +- if(!host_header) +- return FALSE; +- + EnterCriticalSection( &req->headers_section ); + ++ host_header = HTTP_GetHeader(req, hostW); ++ if (host_header) host = host_header->lpszValue; ++ else host = req->server->canon_host_port; ++ + if (req->hdr.dwFlags & INTERNET_FLAG_SECURE) + scheme = https; + else + scheme = http; + strcpyW(buf, scheme); +- strcatW(buf, host_header->lpszValue); ++ strcatW(buf, host); + if (req->path[0] != '/') + strcatW(buf, slash); + strcatW(buf, req->path); +@@ -2132,14 +2134,19 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe + case INTERNET_OPTION_URL: { + static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; + WCHAR url[INTERNET_MAX_URL_LENGTH]; +- HTTPHEADERW *host; ++ HTTPHEADERW *host_header; ++ const WCHAR *host; + + TRACE("INTERNET_OPTION_URL\n"); + + EnterCriticalSection( &req->headers_section ); +- host = HTTP_GetHeader(req, hostW); ++ ++ host_header = HTTP_GetHeader(req, hostW); ++ if (host_header) host = host_header->lpszValue; ++ else host = req->server->canon_host_port; ++ + strcpyW(url, httpW); +- strcatW(url, host->lpszValue); ++ strcatW(url, host); + strcatW(url, req->path); + LeaveCriticalSection( &req->headers_section ); + +@@ -3406,8 +3413,6 @@ static DWORD HTTP_HttpOpenRequestW(http_session_t *session, + request->verb = heap_strdupW(lpszVerb && *lpszVerb ? lpszVerb : szGET); + request->version = heap_strdupW(lpszVersion && *lpszVersion ? lpszVersion : g_szHttp1_1); + +- HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REQ); +- + if (hIC->proxy && hIC->proxy[0] && !HTTP_ShouldBypassProxy(hIC, session->hostName)) + HTTP_DealWithProxy( hIC, session, request ); + +@@ -4900,6 +4905,9 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, + if (!request->verb) + request->verb = heap_strdupW(szGET); + ++ HTTP_ProcessHeader(request, hostW, request->server->canon_host_port, ++ HTTP_ADDREQ_FLAG_ADD_IF_NEW | HTTP_ADDHDR_FLAG_REQ); ++ + if (dwContentLength || strcmpW(request->verb, szGET)) + { + sprintfW(contentLengthStr, szContentLength, dwContentLength); +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 165a76e..2ac075f 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -3038,8 +3038,8 @@ static void test_header_override(int port) + count = 0; + ret = HttpQueryInfoA(req, HTTP_QUERY_HOST | HTTP_QUERY_FLAG_REQUEST_HEADERS, buffer, &size, &count); + err = GetLastError(); +- todo_wine ok(!ret, "HttpQueryInfo succeeded\n"); +- todo_wine ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); ++ ok(!ret, "HttpQueryInfo succeeded\n"); ++ ok(err == ERROR_HTTP_HEADER_NOT_FOUND, "Expected error ERROR_HTTP_HEADER_NOT_FOUND, got %d\n", err); + + memset(buffer, 0, sizeof(buffer)); + size = sizeof(buffer)-1; +@@ -3065,7 +3065,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); + +- test_status_code_todo(req, 200); ++ test_status_code(req, 200); + InternetCloseHandle(req); + + req = HttpOpenRequestA(con, NULL, "/test_host_override", NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0); +@@ -3215,7 +3215,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); + ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); + +- test_status_code(req, 200); ++ test_status_code_todo(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); +@@ -3254,7 +3254,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); + +- test_status_code(req, 200); ++ test_status_code_todo(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); +-- +2.4.0 + diff --git a/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch b/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch new file mode 100644 index 00000000..3a47d26e --- /dev/null +++ b/patches/wininet-Cleanup/0007-wininet-Use-request-server-canon_host_port-in-authen.patch @@ -0,0 +1,49 @@ +From 873ba4c6d8656e3c7b4476a3187e377441a89db6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 01:57:17 +0200 +Subject: wininet: Use request->server->canon_host_port in authentication + process. + +--- + dlls/wininet/http.c | 2 +- + dlls/wininet/tests/http.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index 42e2c30..842734b 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -5117,7 +5117,7 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders, + dwBufferSize=2048; + if (request->status_code == HTTP_STATUS_DENIED) + { +- WCHAR *host = get_host_header( request ); ++ WCHAR *host = heap_strdupW( request->server->canon_host_port ); + DWORD dwIndex = 0; + while (HTTP_HttpQueryInfoW(request,HTTP_QUERY_WWW_AUTHENTICATE,szAuthValue,&dwBufferSize,&dwIndex) == ERROR_SUCCESS) + { +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 2ac075f..9e207b9 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -3215,7 +3215,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA( req, NULL, 0, NULL, 0 ); + ok( ret, "HttpSendRequestA failed %u\n", GetLastError() ); + +- test_status_code_todo(req, 200); ++ test_status_code(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); +@@ -3254,7 +3254,7 @@ static void test_header_override(int port) + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequestA failed %u\n", GetLastError()); + +- test_status_code_todo(req, 200); ++ test_status_code(req, 200); + + InternetCloseHandle(req); + InternetCloseHandle(con); +-- +2.4.0 + diff --git a/patches/wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch b/patches/wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch new file mode 100644 index 00000000..155a8aa6 --- /dev/null +++ b/patches/wininet-Cleanup/0008-wininet-Use-request-server-canon_host_port-when-quer.patch @@ -0,0 +1,54 @@ +From dba35655b6c941bddf018a9b914d46e47d387df4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Sat, 16 May 2015 02:00:57 +0200 +Subject: wininet: Use request->server->canon_host_port when querying for + INTERNET_OPTION_URL. + +--- + dlls/wininet/http.c | 11 +---------- + dlls/wininet/tests/http.c | 2 +- + 2 files changed, 2 insertions(+), 11 deletions(-) + +diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c +index 842734b..d54392c 100644 +--- a/dlls/wininet/http.c ++++ b/dlls/wininet/http.c +@@ -2134,21 +2134,12 @@ static DWORD HTTPREQ_QueryOption(object_header_t *hdr, DWORD option, void *buffe + case INTERNET_OPTION_URL: { + static const WCHAR httpW[] = {'h','t','t','p',':','/','/',0}; + WCHAR url[INTERNET_MAX_URL_LENGTH]; +- HTTPHEADERW *host_header; +- const WCHAR *host; + + TRACE("INTERNET_OPTION_URL\n"); + +- EnterCriticalSection( &req->headers_section ); +- +- host_header = HTTP_GetHeader(req, hostW); +- if (host_header) host = host_header->lpszValue; +- else host = req->server->canon_host_port; +- + strcpyW(url, httpW); +- strcatW(url, host); ++ strcatW(url, req->server->canon_host_port); + strcatW(url, req->path); +- LeaveCriticalSection( &req->headers_section ); + + TRACE("INTERNET_OPTION_URL: %s\n",debugstr_w(url)); + return str_to_buffer(url, buffer, size, unicode); +diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c +index 9e207b9..469995b 100644 +--- a/dlls/wininet/tests/http.c ++++ b/dlls/wininet/tests/http.c +@@ -3060,7 +3060,7 @@ static void test_header_override(int port) + size = sizeof(buffer)-1; + ret = InternetQueryOptionA(req, INTERNET_OPTION_URL, buffer, &size); + ok(ret, "InternetQueryOption failed\n"); +- todo_wine ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); ++ ok(!strcmp(full_url, buffer), "Expected %s, got %s\n", full_url, buffer); + + ret = HttpSendRequestA(req, NULL, 0, NULL, 0); + ok(ret, "HttpSendRequest failed\n"); +-- +2.4.0 + diff --git a/patches/wininet-Cleanup/definition b/patches/wininet-Cleanup/definition new file mode 100644 index 00000000..cb495458 --- /dev/null +++ b/patches/wininet-Cleanup/definition @@ -0,0 +1 @@ +Fixes: [28911] Add HTTP Host header in HttpSendRequest instead of HttpOpenRequest