wininet: Send a content length header for all verbs other than GET.

Hans Leidekker hans at codeweavers.com
Wed Jan 14 09:20:11 CST 2009


diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index cdcf8e1..a5352e4 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -3236,7 +3236,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
     if (!lpwhr->lpszVerb)
         lpwhr->lpszVerb = WININET_strdupW(szGET);
 
-    if (dwContentLength || !strcmpW(lpwhr->lpszVerb, szPost))
+    if (dwContentLength || strcmpW(lpwhr->lpszVerb, szGET))
     {
         sprintfW(contentLengthStr, szContentLength, dwContentLength);
         HTTP_HttpAddRequestHeadersW(lpwhr, contentLengthStr, -1L, HTTP_ADDREQ_FLAG_ADD_IF_NEW);
diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c
index 34f4708..19eb982 100644
--- a/dlls/wininet/tests/http.c
+++ b/dlls/wininet/tests/http.c
@@ -1408,7 +1408,9 @@ static DWORD CALLBACK server_thread(LPVOID param)
             else
                 send(c, notokmsg, sizeof notokmsg-1, 0);
         }
-        if (strstr(buffer, "POST /test5"))
+        if (strstr(buffer, "POST /test5") ||
+            strstr(buffer, "RPC_IN_DATA /test5") ||
+            strstr(buffer, "RPC_OUT_DATA /test5"))
         {
             if (strstr(buffer, "Content-Length: 0"))
             {
@@ -2013,6 +2015,8 @@ static void test_http_connection(void)
     test_proxy_direct(si.port);
     test_header_handling_order(si.port);
     test_basic_request(si.port, "POST", "/test5");
+    test_basic_request(si.port, "RPC_IN_DATA", "/test5");
+    test_basic_request(si.port, "RPC_OUT_DATA", "/test5");
     test_basic_request(si.port, "GET", "/test6");
     test_connection_header(si.port);
     test_http1_1(si.port);



More information about the wine-patches mailing list