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

Unified Diff: chrome/browser/browser_about_handler.cc

Issue 923183003: Move URL fixup to a preliminary phase that doesn't affect virtual URLs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move to BrowserURLHandler Created 5 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: chrome/browser/browser_about_handler.cc
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc
index 7d1958577adfd67905f0e0217cb3c44b65a7c799..f7b7edac84a1867fa409401d5f9a8c8caf97a176 100644
--- a/chrome/browser/browser_about_handler.cc
+++ b/chrome/browser/browser_about_handler.cc
@@ -16,6 +16,16 @@
#include "chrome/common/url_constants.h"
#include "components/url_fixer/url_fixer.h"
+bool FixupBrowserAboutURL(GURL* url,
+ content::BrowserContext* browser_context) {
+ // Ensure that any cleanup done by FixupURL happens before the rewriting
+ // phase that determines the virtual URL, by including it in an initial
+ // URLHandler. This prevents minor changes from producing a virtual URL,
+ // which could lead to a URL spoof.
+ *url = url_fixer::FixupURL(url->possibly_invalid_spec(), std::string());
+ return true;
+}
+
bool WillHandleBrowserAboutURL(GURL* url,
content::BrowserContext* browser_context) {
// TODO(msw): Eliminate "about:*" constants and literals from code and tests,

Powered by Google App Engine
This is Rietveld 408576698