Index: third_party/WebKit/Source/core/loader/PingLoader.cpp |
diff --git a/third_party/WebKit/Source/core/loader/PingLoader.cpp b/third_party/WebKit/Source/core/loader/PingLoader.cpp |
index 7ba64a6a5d11eebbb11b6348040d3a7ec6c886f4..2221d291c077636a125dead3b242ede7a8ff29e5 100644 |
--- a/third_party/WebKit/Source/core/loader/PingLoader.cpp |
+++ b/third_party/WebKit/Source/core/loader/PingLoader.cpp |
@@ -425,6 +425,13 @@ bool sendBeaconCommon(LocalFrame* frame, |
if (!frame->document()) |
return false; |
+ // TODO(mkwst): CSP is not enforced on redirects, crbug.com/372197 |
+ if (!ContentSecurityPolicy::shouldBypassMainWorld(frame->document()) && |
+ !frame->document()->contentSecurityPolicy()->allowConnectToSource(url)) { |
+ // We're simulating a network failure here, so we return 'true'. |
+ return true; |
+ } |
+ |
unsigned long long entitySize = beacon.size(); |
if (allowance < 0 || static_cast<unsigned long long>(allowance) < entitySize) |
return false; |