Bug 1635828 - Isolate HSTS per first-party when privacy.partition.network_state is set to true - part 1 - implementation, r=timhuang,necko-reviewers,dragana

Differential Revision: https://phabricator.services.mozilla.com/D74077
This commit is contained in:
Andrea Marchesini 2020-07-10 15:48:30 +00:00
Родитель cac98dad3c
Коммит c511bc0f58
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -585,8 +585,8 @@ nsresult nsHttpChannel::OnBeforeConnect() {
this, getter_AddRefs(resultPrincipal));
}
OriginAttributes originAttributes;
if (!StoragePrincipalHelper::GetOriginAttributes(
this, originAttributes, StoragePrincipalHelper::eRegularPrincipal)) {
if (!StoragePrincipalHelper::GetOriginAttributesForNetworkState(
this, originAttributes)) {
return NS_ERROR_FAILURE;
}
@ -2183,8 +2183,11 @@ nsresult nsHttpChannel::ProcessSingleSecurityHeader(
// Process header will now discard the headers itself if the channel
// wasn't secure (whereas before it had to be checked manually)
OriginAttributes originAttributes;
StoragePrincipalHelper::GetOriginAttributes(
this, originAttributes, StoragePrincipalHelper::eRegularPrincipal);
if (NS_WARN_IF(!StoragePrincipalHelper::GetOriginAttributesForNetworkState(
this, originAttributes))) {
return NS_ERROR_FAILURE;
}
uint32_t failureResult;
uint32_t headerSource = nsISiteSecurityService::SOURCE_ORGANIC_REQUEST;
rv = sss->ProcessHeader(aType, mURI, securityHeader, aSecInfo, aFlags,