diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index b0ade4a4a78f..0dbed7613f5b 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -2427,13 +2427,20 @@ void nsHttpChannel::ProcessAltService() { nsCOMPtr proxyInfo; NS_NewNotificationCallbacksAggregation(mCallbacks, mLoadGroup, getter_AddRefs(callbacks)); + if (mProxyInfo) { proxyInfo = do_QueryInterface(mProxyInfo); } OriginAttributes originAttributes; - StoragePrincipalHelper::GetOriginAttributes( - this, originAttributes, StoragePrincipalHelper::eRegularPrincipal); + // Regular principal in case we have a proxy. + if (proxyInfo) { + StoragePrincipalHelper::GetOriginAttributes( + this, originAttributes, StoragePrincipalHelper::eRegularPrincipal); + } else { + StoragePrincipalHelper::GetOriginAttributesForNetworkState( + this, originAttributes); + } AltSvcMapping::ProcessHeader( altSvc, scheme, originHost, originPort, mUsername, GetTopWindowOrigin(), @@ -6761,8 +6768,14 @@ nsresult nsHttpChannel::BeginConnect() { SetDoNotTrack(); OriginAttributes originAttributes; - StoragePrincipalHelper::GetOriginAttributes( - this, originAttributes, StoragePrincipalHelper::eRegularPrincipal); + // Regular principal in case we have a proxy. + if (proxyInfo) { + StoragePrincipalHelper::GetOriginAttributes( + this, originAttributes, StoragePrincipalHelper::eRegularPrincipal); + } else { + StoragePrincipalHelper::GetOriginAttributesForNetworkState( + this, originAttributes); + } RefPtr connInfo = new nsHttpConnectionInfo( host, port, EmptyCString(), mUsername, GetTopWindowOrigin(), proxyInfo,