[network] Stop treating http and https as different for encoding schemes.

There is no reason to treat available encoding schemes for these protocols
differently.
This commit is contained in:
Moonchild 2021-07-09 21:18:36 +00:00 committed by roytam1
commit 3612f45a90
4 changed files with 18 additions and 55 deletions

View file

@ -171,10 +171,7 @@ HttpBaseChannel::Init(nsIURI *aURI,
int32_t port = -1;
bool isHTTPS = false;
nsresult rv = mURI->SchemeIs("https", &isHTTPS);
if (NS_FAILED(rv)) return rv;
rv = mURI->GetAsciiHost(host);
nsresult rv = mURI->GetAsciiHost(host);
if (NS_FAILED(rv)) return rv;
// Reject the URL if it doesn't specify a host
@ -201,7 +198,7 @@ HttpBaseChannel::Init(nsIURI *aURI,
rv = mRequestHead.SetHeader(nsHttp::Host, hostLine);
if (NS_FAILED(rv)) return rv;
rv = gHttpHandler->AddStandardRequestHeaders(&mRequestHead, isHTTPS, aContentPolicyType);
rv = gHttpHandler->AddStandardRequestHeaders(&mRequestHead, aContentPolicyType);
if (NS_FAILED(rv)) return rv;
nsAutoCString type;
@ -975,9 +972,7 @@ HttpBaseChannel::DoApplyContentConversions(nsIStreamListener* aNextListener,
break;
}
bool isHTTPS = false;
mURI->SchemeIs("https", &isHTTPS);
if (gHttpHandler->IsAcceptableEncoding(val, isHTTPS)) {
if (gHttpHandler->IsAcceptableEncoding(val)) {
nsCOMPtr<nsIStreamConverterService> serv;
rv = gHttpHandler->GetStreamConverterService(getter_AddRefs(serv));