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

Unified Diff: Source/core/fetch/ResourceFetcher.cpp

Issue 999473002: Revert of Upgrade insecure requests: Pipe navigational hosts down into nested documents. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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: Source/core/fetch/ResourceFetcher.cpp
diff --git a/Source/core/fetch/ResourceFetcher.cpp b/Source/core/fetch/ResourceFetcher.cpp
index 689d8f481624f4b1bb1f63787e7336bf613a2381..4539a04d838e6c3a7fd524cee244a31cc4aa923b 100644
--- a/Source/core/fetch/ResourceFetcher.cpp
+++ b/Source/core/fetch/ResourceFetcher.cpp
@@ -886,17 +886,16 @@
fetchRequest.mutableResourceRequest().addHTTPHeaderField("Prefer", "return=secure-representation");
if (document()->insecureRequestsPolicy() == SecurityContext::InsecureRequestsUpgrade && url.protocolIs("http")) {
+ // We always upgrade subresource requests and nested frames, we always upgrade form
+ // submissions, and we always upgrade requests whose host matches the host of the
+ // containing document's security origin.
+ //
+ // FIXME: We need to check the document that set the policy, not the current document.
const ResourceRequest& request = fetchRequest.resourceRequest();
-
- // We always upgrade requests that meet any of the following criteria:
- //
- // 1. Are for subresources (including nested frames).
- // 2. Are form submissions.
- // 3. Whose hosts are contained in the document's InsecureNavigationSet.
if (request.frameType() == WebURLRequest::FrameTypeNone
|| request.frameType() == WebURLRequest::FrameTypeNested
|| request.requestContext() == WebURLRequest::RequestContextForm
- || document()->insecureNavigationsToUpgrade()->contains(url.host().impl()->hash()))
Yoav Weiss 2015/03/10 19:03:05 Again, here we relied on the existence of document
+ || url.host() == document()->securityOrigin()->host())
Yoav Weiss 2015/03/10 19:03:05 Should we assert for document()->securityOrigin()
{
url.setProtocol("https");
if (url.port() == 80)

Powered by Google App Engine
This is Rietveld 408576698