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

Unified Diff: content/browser/web_contents/navigation_controller_impl.cc

Issue 27045005: When a page is reloaded using the original request URL, ensure that the RVH picked to render it is … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments Created 7 years, 2 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 | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/navigation_controller_impl.cc
===================================================================
--- content/browser/web_contents/navigation_controller_impl.cc (revision 227958)
+++ content/browser/web_contents/navigation_controller_impl.cc (working copy)
@@ -303,6 +303,15 @@
if (!entry)
return;
+ if (reload_type == NavigationControllerImpl::RELOAD_ORIGINAL_REQUEST_URL &&
+ entry->GetOriginalRequestURL().is_valid() && !entry->GetHasPostData()) {
+ // We may have been redirected when navigating to the current URL.
+ // Use the URL the user originally intended to visit, if it's valid and if a
+ // POST wasn't involved; the latter case avoids issues with sending data to
+ // the wrong page.
+ entry->SetURL(entry->GetOriginalRequestURL());
+ }
+
if (g_check_for_repost && check_for_repost &&
entry->GetHasPostData()) {
// The user is asking to reload a page with POST data. Prompt to make sure
« no previous file with comments | « no previous file | content/browser/web_contents/navigation_controller_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698