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

Unified Diff: chrome/browser/ui/login/login_prompt.cc

Issue 410373003: Fix cross origin check when deciding to show the HTTP auth interstitial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Check only LastCommittedURL Created 6 years, 4 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/ui/login/login_prompt.cc
diff --git a/chrome/browser/ui/login/login_prompt.cc b/chrome/browser/ui/login/login_prompt.cc
index 53f68a7b4a8f518502bdf7c005e1aaa274b15769..60283b6da965f721f47d3332af854ce2aefd87d1 100644
--- a/chrome/browser/ui/login/login_prompt.cc
+++ b/chrome/browser/ui/login/login_prompt.cc
@@ -509,8 +509,15 @@ void LoginDialogCallback(const GURL& request_url,
return;
}
+ // Check if the request is cross origin. There are two different ways it can
Peter Kasting 2014/08/06 01:07:54 Nit: "it can be cross origin" -> "the navigation c
meacer 2014/08/06 17:36:49 Done.
+ // be cross origin:
+ // 1- The user enters the resource URL in the omnibox.
nasko 2014/08/06 10:17:36 nit: This will not be true once site isolation is
meacer 2014/08/06 17:36:49 I added your description as a note to the end.
+ // 2- The page redirects to the resource.
+ // In both cases, the last committed URL is different than the resource URL,
+ // so checking it is sufficient.
if (is_main_frame &&
- parent_contents->GetVisibleURL().GetOrigin() != request_url.GetOrigin()) {
+ parent_contents->GetLastCommittedURL().GetOrigin() !=
+ request_url.GetOrigin()) {
// Show a blank interstitial for main-frame, cross origin requests
// so that the correct URL is shown in the omnibox.
base::Closure callback = base::Bind(&ShowLoginPrompt,

Powered by Google App Engine
This is Rietveld 408576698