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

Unified Diff: third_party/WebKit/Source/core/loader/MixedContentChecker.cpp

Issue 2126753003: `about:blank` is not mixed content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
diff --git a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
index 9f5c405b19b429bfbfdcc44b7c46ad467ea10989..7e93384f0b99cea593cc969970e56594e8cf159b 100644
--- a/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
+++ b/third_party/WebKit/Source/core/loader/MixedContentChecker.cpp
@@ -89,8 +89,10 @@ bool MixedContentChecker::isMixedContent(SecurityOrigin* securityOrigin, const K
return false;
// |url| is mixed content if its origin is not potentially trustworthy, and
- // its protocol is not 'data'.
- bool isAllowed = url.protocolIsData() || SecurityOrigin::create(url)->isPotentiallyTrustworthy();
+ // its protocol is not 'data'. We do a quick check against `SecurityOrigin::isSecure`
+ // to catch things like `about:blank`, which cannot be sanely passed into
+ // `SecurityOrigin::create` (as their origin depends on their context).
+ bool isAllowed = url.protocolIsData() || SecurityOrigin::isSecure(url) || SecurityOrigin::create(url)->isPotentiallyTrustworthy();
// TODO(mkwst): Remove this once 'localhost' is no longer considered potentially trustworthy:
if (isAllowed && url.protocolIs("http") && url.host() == "localhost")
isAllowed = false;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/MixedContentCheckerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698