wininet: Insert custom headers only once in HTTP_HttpSendRequestW.

This commit is contained in:
Jacek Caban 2012-01-24 17:31:38 +01:00 committed by Alexandre Julliard
parent ac26517ac9
commit dfa9f4bc26

View File

@ -4707,6 +4707,10 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
HTTP_HttpAddRequestHeadersW(request, cache_control, strlenW(cache_control), HTTP_ADDREQ_FLAG_ADD_IF_NEW);
}
/* add the headers the caller supplied */
if( lpszHeaders && dwHeaderLength )
HTTP_HttpAddRequestHeadersW(request, lpszHeaders, dwHeaderLength, HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REPLACE);
do
{
DWORD len;
@ -4740,13 +4744,6 @@ static DWORD HTTP_HttpSendRequestW(http_request_t *request, LPCWSTR lpszHeaders,
if (!(request->hdr.dwFlags & INTERNET_FLAG_NO_COOKIES))
HTTP_InsertCookies(request);
/* add the headers the caller supplied */
if( lpszHeaders && dwHeaderLength )
{
HTTP_HttpAddRequestHeadersW(request, lpszHeaders, dwHeaderLength,
HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REPLACE);
}
if (request->session->appInfo->proxy && request->session->appInfo->proxy[0])
{
WCHAR *url = HTTP_BuildProxyRequestUrl(request);