wininet: Strip Accept-Encoding from http/1.0 requests.

This commit is contained in:
Aric Stewart 2007-07-26 08:59:00 -05:00 committed by Alexandre Julliard
parent 510c4dc749
commit c8dfc02bfb
1 changed files with 23 additions and 2 deletions

View File

@ -118,6 +118,7 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD
lpdwIndex);
static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl);
static UINT HTTP_DecodeBase64(LPCWSTR base64, LPSTR bin);
static BOOL HTTP_VerifyValidHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field);
LPHTTPHEADERW HTTP_GetHeader(LPWININETHTTPREQW req, LPCWSTR head)
@ -636,8 +637,10 @@ static BOOL WINAPI HTTP_HttpAddRequestHeadersW(LPWININETHTTPREQW lpwhr,
pFieldAndValue = HTTP_InterpretHttpHeader(lpszStart);
if (pFieldAndValue)
{
bSuccess = HTTP_ProcessHeader(lpwhr, pFieldAndValue[0],
pFieldAndValue[1], dwModifier | HTTP_ADDHDR_FLAG_REQ);
bSuccess = HTTP_VerifyValidHeader(lpwhr, pFieldAndValue[0]);
if (bSuccess)
bSuccess = HTTP_ProcessHeader(lpwhr, pFieldAndValue[0],
pFieldAndValue[1], dwModifier | HTTP_ADDHDR_FLAG_REQ);
HTTP_FreeTokens(pFieldAndValue);
}
@ -3516,6 +3519,24 @@ static BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index)
return TRUE;
}
/***********************************************************************
* HTTP_VerifyValidHeader (internal)
*
* Verify the given header is not invalid for the given http request
*
*/
static BOOL HTTP_VerifyValidHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field)
{
BOOL rc = TRUE;
/* Accept-Encoding is stripped from HTTP/1.0 requests. It is invalid */
if (strcmpiW(field,szAccept_Encoding)==0)
return FALSE;
return rc;
}
/***********************************************************************
* IsHostInProxyBypassList (@)
*