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

Unified Diff: content/public/common/url_utils.cc

Issue 2644133002: Do not sanitize about:blank/#foo & about:blank?foo (Closed)
Patch Set: Created 3 years, 11 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: content/public/common/url_utils.cc
diff --git a/content/public/common/url_utils.cc b/content/public/common/url_utils.cc
index 5ca69aa84a436a5ae3ecfd15e2ee14e864236c61..d477af3af6c1d3a2a879af784b6535204550a04e 100644
--- a/content/public/common/url_utils.cc
+++ b/content/public/common/url_utils.cc
@@ -23,4 +23,19 @@ bool IsSavableURL(const GURL& url) {
return false;
}
+bool IsAboutBlankURL(const GURL& url) {
+ if (!url.SchemeIs(url::kAboutScheme))
+ return false;
+
+ if (url.has_host() || url.has_username() || url.has_password() ||
+ url.has_port()) {
+ return false;
+ }
+
+ if (url.path() != kAboutBlankPath && url.path() !=kAboutBlankWithHashPath)
Charlie Reis 2017/01/19 22:36:35 nit: Space after !=
clamy 2017/01/20 12:51:53 Done.
+ return false;
+
+ return true;
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698