Bug 1647719: Introduce Pref for HTTS-Only in Private Browsing Mode. r=JulianWels,jcj

Differential Revision: https://phabricator.services.mozilla.com/D80873
This commit is contained in:
Christoph Kerschbaumer
2020-07-06 08:52:02 +00:00
parent dfdbf0f21f
commit d57281e984
11 changed files with 223 additions and 12 deletions

View File

@@ -9057,7 +9057,8 @@ nsIPrincipal* nsDocShell::GetInheritedPrincipal(
// If the HTTPS-Only mode is enabled, every insecure request gets upgraded to
// HTTPS by default. This behavior can be disabled through the loadinfo flag
// HTTPS_ONLY_EXEMPT.
if (mozilla::StaticPrefs::dom_security_https_only_mode()) {
bool isPrivateWin = attrs.mPrivateBrowsingId > 0;
if (nsHTTPSOnlyUtils::IsHttpsOnlyModeEnabled(isPrivateWin)) {
// Let's create a new content principal based on the URI for the
// PermissionManager
nsCOMPtr<nsIPrincipal> permissionPrincipal =