Index: third_party/WebKit/Source/core/frame/csp/CSPSource.cpp |
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp |
index 0d2dfe1a4f3665f150cde6ff3d3be7004ab91d68..de2d69b1efd00ad63b46c8f11f192b9d330156db 100644 |
--- a/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp |
+++ b/third_party/WebKit/Source/core/frame/csp/CSPSource.cpp |
@@ -145,6 +145,13 @@ CSPSource* CSPSource::intersect(CSPSource* other) { |
return nullptr; |
String scheme = other->schemeMatches(m_scheme) ? m_scheme : other->m_scheme; |
+ if (isSchemeOnly() || other->isSchemeOnly()) { |
Mike West
2016/11/17 10:58:31
Unit test?
amalika
2016/11/19 18:34:32
Added `IntersectSchemesOnly`!
(and test `Intersect
|
+ CSPSource* stricter = isSchemeOnly() ? other : this; |
+ return new CSPSource(m_policy, scheme, stricter->m_host, stricter->m_port, |
+ stricter->m_path, stricter->m_hostWildcard, |
+ stricter->m_portWildcard); |
+ } |
+ |
String host = m_hostWildcard == NoWildcard ? m_host : other->m_host; |
String path = other->pathMatches(m_path) ? m_path : other->m_path; |
int port = (other->m_portWildcard == HasWildcard || !other->m_port) |