Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Unified Diff: third_party/WebKit/Source/core/dom/ExecutionContext.cpp

Issue 2690933003: Don't sanitize errors if the protocol is "data:" (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/ExecutionContext.cpp
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
index 149cd19ff7be676ed587f3f375502f10e036290a..664bcda9343c1fe53de02683268aa657c7833e98 100644
--- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
+++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
@@ -98,7 +98,10 @@ bool ExecutionContext::shouldSanitizeScriptError(
AccessControlStatus corsStatus) {
if (corsStatus == OpaqueResource)
return true;
- return !(getSecurityOrigin()->canRequestNoSuborigin(completeURL(sourceURL)) ||
+ const KURL& url = completeURL(sourceURL);
+ if (url.protocolIsData())
+ return false;
+ return !(getSecurityOrigin()->canRequestNoSuborigin(url) ||
corsStatus == SharableCrossOrigin);
}

Powered by Google App Engine
This is Rietveld 408576698