wininet: Use HTTP_ADDHDR_FLAG_REPLACE flag in HTTP_HttpSendRequest to add Content-Length header.

This commit is contained in:
Jacek Caban 2006-10-20 15:39:00 +02:00 committed by Alexandre Julliard
parent 9d058e9143
commit cc7a86ec7e

View File

@ -2240,7 +2240,8 @@ BOOL WINAPI HTTP_HttpSendRequestW(LPWININETHTTPREQW lpwhr, LPCWSTR lpszHeaders,
'C','o','n','t','e','n','t','-','L','e','n','g','t','h',':',' ','%','l','i','\r','\n',0};
WCHAR contentLengthStr[sizeof szContentLength/2 /* includes \n\r */ + 20 /* int */ ];
sprintfW(contentLengthStr, szContentLength, dwContentLength);
HTTP_HttpAddRequestHeadersW(lpwhr, contentLengthStr, -1L, HTTP_ADDREQ_FLAG_ADD);
HTTP_HttpAddRequestHeadersW(lpwhr, contentLengthStr, -1L,
HTTP_ADDREQ_FLAG_ADD | HTTP_ADDHDR_FLAG_REPLACE);
}
Host = HTTP_GetHeader(lpwhr,szHost);