Index: components/omnibox/autocomplete_match.cc |
diff --git a/components/omnibox/autocomplete_match.cc b/components/omnibox/autocomplete_match.cc |
index d19f8e9b56031961555e2f2db05fc075080bfaa3..242caf71fd5570fd1075254aa3a5b9b98a1d99fa 100644 |
--- a/components/omnibox/autocomplete_match.cc |
+++ b/components/omnibox/autocomplete_match.cc |
@@ -415,6 +415,16 @@ GURL AutocompleteMatch::GURLToStrippedGURL( |
needs_replacement = true; |
} |
+ // Add a trailing slash if the path does not have one. |
Peter Kasting
2015/06/11 23:05:37
Nit: I might add "It's OK if this adds a slash eve
Mark P
2015/06/12 17:25:57
Done. (I thought it was clear from preexisting co
Peter Kasting
2015/06/12 17:49:04
It's clear we're not going to navigate there -- bu
Mark P
2015/06/12 18:04:59
I think the problem with lone slashes cannot be ea
Peter Kasting
2015/06/12 18:25:37
Well, just because another protocol may allow an e
|
+ const std::string& path = stripped_destination_url.path(); |
+ // |path_with_extra_slash| lives at this scope rather than inside the if |
+ // statement because it has to live until the ReplaceComponents() call below. |
+ std::string path_with_extra_slash(path + '/'); |
+ if (path.empty() || (path.back() != '/')) { |
+ replacements.SetPathStr(base::StringPiece(path_with_extra_slash)); |
+ needs_replacement = true; |
+ } |
+ |
// Replace https protocol with http protocol. |
if (stripped_destination_url.SchemeIs(url::kHttpsScheme)) { |
replacements.SetScheme(url::kHttpScheme, |