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

Unified Diff: Source/core/loader/FrameFetchContext.cpp

Issue 1178093002: Correctly send the 'HTTPS' header for top-level navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tests. Created 5 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
Index: Source/core/loader/FrameFetchContext.cpp
diff --git a/Source/core/loader/FrameFetchContext.cpp b/Source/core/loader/FrameFetchContext.cpp
index 2501a98aa347ef02edd9a98b3d57dce76dc00120..c83341fdd929bfa6798a8dd588a275de175624ea 100644
--- a/Source/core/loader/FrameFetchContext.cpp
+++ b/Source/core/loader/FrameFetchContext.cpp
@@ -580,9 +580,6 @@ String FrameFetchContext::charset() const
void FrameFetchContext::upgradeInsecureRequest(FetchRequest& fetchRequest)
{
- if (!m_document)
- return;
-
KURL url = fetchRequest.resourceRequest().url();
// Tack an 'HTTPS' header to outgoing navigational requests, as described in
@@ -590,7 +587,7 @@ void FrameFetchContext::upgradeInsecureRequest(FetchRequest& fetchRequest)
if (fetchRequest.resourceRequest().frameType() != WebURLRequest::FrameTypeNone)
fetchRequest.mutableResourceRequest().addHTTPHeaderField("HTTPS", "1");
- if (m_document->insecureRequestsPolicy() == SecurityContext::InsecureRequestsUpgrade && url.protocolIs("http")) {
+ if (m_document && m_document->insecureRequestsPolicy() == SecurityContext::InsecureRequestsUpgrade && url.protocolIs("http")) {
ASSERT(m_document->insecureNavigationsToUpgrade());
// We always upgrade requests that meet any of the following criteria:

Powered by Google App Engine
This is Rietveld 408576698