Commit 1c07d94d authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

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

parent 31fd0663
...@@ -3236,7 +3236,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders, ...@@ -3236,7 +3236,7 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
if (!lpwhr->lpszVerb) if (!lpwhr->lpszVerb)
lpwhr->lpszVerb = WININET_strdupW(szGET); lpwhr->lpszVerb = WININET_strdupW(szGET);
if (dwContentLength || !strcmpW(lpwhr->lpszVerb, szPost)) if (dwContentLength || strcmpW(lpwhr->lpszVerb, szGET))
{ {
sprintfW(contentLengthStr, szContentLength, dwContentLength); sprintfW(contentLengthStr, szContentLength, dwContentLength);
HTTP_HttpAddRequestHeadersW(lpwhr, contentLengthStr, -1L, HTTP_ADDREQ_FLAG_ADD_IF_NEW); HTTP_HttpAddRequestHeadersW(lpwhr, contentLengthStr, -1L, HTTP_ADDREQ_FLAG_ADD_IF_NEW);
......
...@@ -1408,7 +1408,9 @@ static DWORD CALLBACK server_thread(LPVOID param) ...@@ -1408,7 +1408,9 @@ static DWORD CALLBACK server_thread(LPVOID param)
else else
send(c, notokmsg, sizeof notokmsg-1, 0); 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")) if (strstr(buffer, "Content-Length: 0"))
{ {
...@@ -2013,6 +2015,8 @@ static void test_http_connection(void) ...@@ -2013,6 +2015,8 @@ static void test_http_connection(void)
test_proxy_direct(si.port); test_proxy_direct(si.port);
test_header_handling_order(si.port); test_header_handling_order(si.port);
test_basic_request(si.port, "POST", "/test5"); 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_basic_request(si.port, "GET", "/test6");
test_connection_header(si.port); test_connection_header(si.port);
test_http1_1(si.port); test_http1_1(si.port);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment