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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2096453002: Don't commit the blocked URL when a frame is blocked by XFrameOptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace updateForSameDocumentNavigation with explicit code to update the URL Created 4 years, 6 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 | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/DocumentLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
index b238477105003a682e4f1cb4b27883b6aa3125cc..447bd423cc7bec19cfef2d5e9b00fcae3af807d3 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.cpp
@@ -362,9 +362,18 @@ void DocumentLoader::cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceRespo
setWasBlockedAfterXFrameOptionsOrCSP();
- // Pretend that this was an empty HTTP 200 response.
+ // Pretend that this was an empty HTTP 200 response. Don't reuse the
+ // original URL for the empty page (https://crbug.com/622385).
+ //
+ // TODO(mkwst): Remove this once XFO moves to the browser.
+ // https://crbug.com/555418.
clearMainResourceHandle();
- m_response = ResourceResponse(blankURL(), "text/html", 0, nullAtom, String());
+ KURL blockedURL = SecurityOrigin::urlWithUniqueSecurityOrigin();
+ m_originalRequest.setURL(blockedURL);
+ m_request.setURL(blockedURL);
+ m_redirectChain.removeLast();
+ appendRedirect(blockedURL);
+ m_response = ResourceResponse(blockedURL, "text/html", 0, nullAtom, String());
finishedLoading(monotonicallyIncreasingTime());
return;
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698