summaryrefslogtreecommitdiffstats
path: root/dom/security/nsCSPContext.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2017-08-25 09:18:29 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-22 11:15:23 +0100
commit62d535967977ea64884e4418d78f1dc245e682e1 (patch)
tree0b2bc214e7f77ac74a646987d6b22d18e2cdee9f /dom/security/nsCSPContext.cpp
parent6f96569b4499be07c210ca6c38739bbbc7ebdee7 (diff)
downloadUXP-62d535967977ea64884e4418d78f1dc245e682e1.tar
UXP-62d535967977ea64884e4418d78f1dc245e682e1.tar.gz
UXP-62d535967977ea64884e4418d78f1dc245e682e1.tar.lz
UXP-62d535967977ea64884e4418d78f1dc245e682e1.tar.xz
UXP-62d535967977ea64884e4418d78f1dc245e682e1.zip
CSP 2 - ignore (x-)frame-options if CSP with frame-ancestors directive exists
Diffstat (limited to 'dom/security/nsCSPContext.cpp')
-rw-r--r--dom/security/nsCSPContext.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/dom/security/nsCSPContext.cpp b/dom/security/nsCSPContext.cpp
index 815c7734d..0a3e20305 100644
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -343,6 +343,20 @@ nsCSPContext::GetBlockAllMixedContent(bool *outBlockAllMixedContent)
}
NS_IMETHODIMP
+nsCSPContext::GetEnforcesFrameAncestors(bool *outEnforcesFrameAncestors)
+{
+ *outEnforcesFrameAncestors = false;
+ for (uint32_t i = 0; i < mPolicies.Length(); i++) {
+ if (!mPolicies[i]->getReportOnlyFlag() &&
+ mPolicies[i]->hasDirective(nsIContentSecurityPolicy::FRAME_ANCESTORS_DIRECTIVE)) {
+ *outEnforcesFrameAncestors = true;
+ return NS_OK;
+ }
+ }
+ return NS_OK;
+}
+
+NS_IMETHODIMP
nsCSPContext::GetReferrerPolicy(uint32_t* outPolicy, bool* outIsSet)
{
*outIsSet = false;