From dfa9f4bc26d78bb27f411cda3a176783726de907 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 24 Jan 2012 17:31:38 +0100 Subject: [PATCH] wininet: Insert custom headers only once in HTTP_HttpSendRequestW. --- dlls/wininet/http.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 24e55b3344..3c5ed9c262 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -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);