| Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| index 9484ef33df18af1cf827b7452e145e91a9b57fa2..327bacee7a220ea4127de89d2c72268c14e31170 100644
|
| --- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| +++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
|
| @@ -556,8 +556,12 @@ ResourceRequestBlockedReason FrameFetchContext::canRequestInternal(Resource::Typ
|
| // get a warning in the console about CSP blocking the load.
|
| MixedContentChecker::ReportingStatus mixedContentReporting = forPreload ?
|
| MixedContentChecker::SuppressReport : MixedContentChecker::SendReport;
|
| - if (MixedContentChecker::shouldBlockFetch(frame(), resourceRequest, url, mixedContentReporting))
|
| - return ResourceRequestBlockedReasonMixedContent;
|
| + // TODO(mkwst): Skip mixed content checks when UIR is enabled. For science. (Remove this.)
|
| + WebInsecureRequestPolicy relevantPolicy = m_document ? m_document->getInsecureRequestPolicy() : frame()->loader().getInsecureRequestPolicy();
|
| + if (!(relevantPolicy & kUpgradeInsecureRequests)) {
|
| + if (MixedContentChecker::shouldBlockFetch(frame(), resourceRequest, url, mixedContentReporting))
|
| + return ResourceRequestBlockedReasonMixedContent;
|
| + }
|
|
|
| // Let the client have the final say into whether or not the load should proceed.
|
| DocumentLoader* documentLoader = masterDocumentLoader();
|
| @@ -682,14 +686,19 @@ void FrameFetchContext::upgradeInsecureRequest(FetchRequest& fetchRequest)
|
|
|
| // If we don't yet have an |m_document| (because we're loading an iframe, for instance), check the FrameLoader's policy.
|
| WebInsecureRequestPolicy relevantPolicy = m_document ? m_document->getInsecureRequestPolicy() : frame()->loader().getInsecureRequestPolicy();
|
| - SecurityContext::InsecureNavigationsSet* relevantNavigationSet = m_document ? m_document->insecureNavigationsToUpgrade() : frame()->loader().insecureNavigationsToUpgrade();
|
|
|
| + // printf("Setting %s policy to %d\n", url.getString().utf8().data(), relevantPolicy);
|
| +
|
| + fetchRequest.mutableResourceRequest().setInsecureRequestPolicy(relevantPolicy);
|
| +
|
| + /*
|
| if (url.protocolIs("http") && relevantPolicy & kUpgradeInsecureRequests) {
|
| // 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.
|
| + SecurityContext::InsecureNavigationsSet* relevantNavigationSet = m_document ? m_document->insecureNavigationsToUpgrade() : frame()->loader().insecureNavigationsToUpgrade();
|
| const ResourceRequest& request = fetchRequest.resourceRequest();
|
| if (request.frameType() == WebURLRequest::FrameTypeNone
|
| || request.frameType() == WebURLRequest::FrameTypeNested
|
| @@ -703,6 +712,7 @@ void FrameFetchContext::upgradeInsecureRequest(FetchRequest& fetchRequest)
|
| fetchRequest.mutableResourceRequest().setURL(url);
|
| }
|
| }
|
| + */
|
| }
|
|
|
| void FrameFetchContext::addClientHintsIfNecessary(FetchRequest& fetchRequest)
|
|
|