Index: content/browser/frame_host/navigation_entry_impl.cc |
diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc |
index 5e47912398bed6bf721136e8b2ae7b979241052d..97c4a0efd2a871bdb601e2ee3caccf97f9013126 100644 |
--- a/content/browser/frame_host/navigation_entry_impl.cc |
+++ b/content/browser/frame_host/navigation_entry_impl.cc |
@@ -446,10 +446,22 @@ CommonNavigationParams NavigationEntryImpl::ConstructCommonNavigationParams( |
ui_timestamp = intent_received_timestamp(); |
#endif |
+ GURL url = frame_entry.url(); |
+ Referrer referrer = frame_entry.referrer(); |
+ if (navigation_type == FrameMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL && |
+ GetOriginalRequestURL().is_valid() && !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. |
+ url = GetOriginalRequestURL(); |
+ referrer = Referrer(); |
+ } |
+ |
return CommonNavigationParams( |
- frame_entry.url(), frame_entry.referrer(), GetTransitionType(), |
- navigation_type, !IsViewSourceMode(), ui_timestamp, report_type, |
- GetBaseURLForDataURL(), GetHistoryURLForDataURL()); |
+ url, referrer, GetTransitionType(), navigation_type, !IsViewSourceMode(), |
+ ui_timestamp, report_type, GetBaseURLForDataURL(), |
+ GetHistoryURLForDataURL()); |
} |
StartNavigationParams NavigationEntryImpl::ConstructStartNavigationParams() |