wininet: Strip Accept-Encoding from http/1.0 requests.
This commit is contained in:
parent
510c4dc749
commit
c8dfc02bfb
|
@ -118,6 +118,7 @@ static BOOL WINAPI HTTP_HttpQueryInfoW( LPWININETHTTPREQW lpwhr, DWORD
|
||||||
lpdwIndex);
|
lpdwIndex);
|
||||||
static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl);
|
static BOOL HTTP_HandleRedirect(LPWININETHTTPREQW lpwhr, LPCWSTR lpszUrl);
|
||||||
static UINT HTTP_DecodeBase64(LPCWSTR base64, LPSTR bin);
|
static UINT HTTP_DecodeBase64(LPCWSTR base64, LPSTR bin);
|
||||||
|
static BOOL HTTP_VerifyValidHeader(LPWININETHTTPREQW lpwhr, LPCWSTR field);
|
||||||
|
|
||||||
|
|
||||||
LPHTTPHEADERW HTTP_GetHeader(LPWININETHTTPREQW req, LPCWSTR head)
|
LPHTTPHEADERW HTTP_GetHeader(LPWININETHTTPREQW req, LPCWSTR head)
|
||||||
|
@ -636,6 +637,8 @@ static BOOL WINAPI HTTP_HttpAddRequestHeadersW(LPWININETHTTPREQW lpwhr,
|
||||||
pFieldAndValue = HTTP_InterpretHttpHeader(lpszStart);
|
pFieldAndValue = HTTP_InterpretHttpHeader(lpszStart);
|
||||||
if (pFieldAndValue)
|
if (pFieldAndValue)
|
||||||
{
|
{
|
||||||
|
bSuccess = HTTP_VerifyValidHeader(lpwhr, pFieldAndValue[0]);
|
||||||
|
if (bSuccess)
|
||||||
bSuccess = HTTP_ProcessHeader(lpwhr, pFieldAndValue[0],
|
bSuccess = HTTP_ProcessHeader(lpwhr, pFieldAndValue[0],
|
||||||
pFieldAndValue[1], dwModifier | HTTP_ADDHDR_FLAG_REQ);
|
pFieldAndValue[1], dwModifier | HTTP_ADDHDR_FLAG_REQ);
|
||||||
HTTP_FreeTokens(pFieldAndValue);
|
HTTP_FreeTokens(pFieldAndValue);
|
||||||
|
@ -3516,6 +3519,24 @@ static BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index)
|
||||||
return TRUE;
|
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 (@)
|
* IsHostInProxyBypassList (@)
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue