| Index: Source/core/loader/FrameFetchContext.cpp
|
| diff --git a/Source/core/loader/FrameFetchContext.cpp b/Source/core/loader/FrameFetchContext.cpp
|
| index 2ff4516d9dd31350df7f2432cb91f7a2a676147a..5ef3cf165b1b94f40685d438d3f957b5ee5ce34c 100644
|
| --- a/Source/core/loader/FrameFetchContext.cpp
|
| +++ b/Source/core/loader/FrameFetchContext.cpp
|
| @@ -630,16 +630,18 @@ void FrameFetchContext::upgradeInsecureRequest(FetchRequest& fetchRequest)
|
| fetchRequest.mutableResourceRequest().addHTTPHeaderField("Prefer", "return=secure-representation");
|
|
|
| if (m_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.
|
| + ASSERT(m_document->insecureNavigationsToUpgrade());
|
| +
|
| + // We always upgrade requests that meet any of the following criteria:
|
| //
|
| - // FIXME: We need to check the document that set the policy, not the current document.
|
| + // 1. Are for subresources (including nested frames).
|
| + // 2. Are form submissions.
|
| + // 3. Whose hosts are contained in the document's InsecureNavigationSet.
|
| const ResourceRequest& request = fetchRequest.resourceRequest();
|
| if (request.frameType() == WebURLRequest::FrameTypeNone
|
| || request.frameType() == WebURLRequest::FrameTypeNested
|
| || request.requestContext() == WebURLRequest::RequestContextForm
|
| - || url.host() == document()->securityOrigin()->host())
|
| + || (!url.host().isNull() && m_document->insecureNavigationsToUpgrade()->contains(url.host().impl()->hash())))
|
| {
|
| url.setProtocol("https");
|
| if (url.port() == 80)
|
|
|