Commit 6b2385b3 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! TB 3455: Add DomainIsolator, for isolating circuit by domain.

TB 44841: Handle invalid origin attributes.

originAttributes should not be null, but just in case add a few more
checks.
parent f49435e3
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -321,8 +321,10 @@ class TorDomainIsolatorImpl {
    }
    try {
      const channel = aChannel.QueryInterface(Ci.nsIChannel);
      let firstPartyDomain = channel.loadInfo.originAttributes.firstPartyDomain;
      const userContextId = channel.loadInfo.originAttributes.userContextId;
      let firstPartyDomain =
        channel.loadInfo.originAttributes?.firstPartyDomain;
      const userContextId =
        channel.loadInfo.originAttributes?.userContextId ?? 0;
      const scheme = channel.loadInfo.loadingPrincipal?.URI?.scheme;
      const filePath = channel.loadInfo.loadingPrincipal?.URI?.filePath;
      if (
@@ -375,7 +377,7 @@ class TorDomainIsolatorImpl {
      );
    } catch (e) {
      logger.error("Error while setting a new proxy", e);
      return null;
      return aProxy;
    }
  }