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-09-20 20:51:11 +00:00
Родитель aec8cecc03
Коммит 7c4292e435
1 изменённых файлов: 7 добавлений и 4 удалений

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

@ -587,8 +587,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;
}
@ -2273,8 +2273,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,