Backed out changeset 117114b8eb32 (bug 1793560) for causing wpt failures at iframe-all-local-schemes-inherit-self.sub.html CLOSED TREE
This commit is contained in:
@@ -3544,7 +3544,8 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
|
||||
CopyUTF8toUTF16(host, *formatStrs.AppendElement());
|
||||
error = "netTimeout";
|
||||
} else if (NS_ERROR_CSP_FRAME_ANCESTOR_VIOLATION == aError ||
|
||||
NS_ERROR_CSP_FORM_ACTION_VIOLATION == aError) {
|
||||
NS_ERROR_CSP_FORM_ACTION_VIOLATION == aError ||
|
||||
NS_ERROR_CSP_NAVIGATE_TO_VIOLATION == aError) {
|
||||
// CSP error
|
||||
cssClass.AssignLiteral("neterror");
|
||||
error = "cspBlocked";
|
||||
@@ -10572,6 +10573,22 @@ nsresult nsDocShell::DoURILoad(nsDocShellLoadState* aLoadState,
|
||||
NS_ADDREF(*aRequest = channel);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContentSecurityPolicy> csp = aLoadState->Csp();
|
||||
if (csp) {
|
||||
// Check CSP navigate-to
|
||||
bool allowsNavigateTo = false;
|
||||
rv = csp->GetAllowsNavigateTo(aLoadState->URI(),
|
||||
aLoadState->IsFormSubmission(),
|
||||
false, /* aWasRedirected */
|
||||
false, /* aEnforceWhitelist */
|
||||
&allowsNavigateTo);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (!allowsNavigateTo) {
|
||||
return NS_ERROR_CSP_NAVIGATE_TO_VIOLATION;
|
||||
}
|
||||
}
|
||||
|
||||
const nsACString& typeHint = aLoadState->TypeHint();
|
||||
if (!typeHint.IsVoid()) {
|
||||
mContentTypeHint = typeHint;
|
||||
|
||||
Reference in New Issue
Block a user