summaryrefslogtreecommitdiffstats
path: root/netwerk/protocol/http/nsHttpChannel.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-11-28 23:10:30 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-11-28 23:10:30 +0100
commit088c3cf890cc2d96f2093e2116612cbf65bfaeea (patch)
treeb4d3c68155f2de43432dd00c167d3029732be146 /netwerk/protocol/http/nsHttpChannel.cpp
parentec3829bf7266ebec111f41268c6c491356576df1 (diff)
parentfe11e14d3cfc2900facf152257acda87280b6cdc (diff)
downloadUXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.tar
UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.tar.gz
UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.tar.lz
UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.tar.xz
UXP-088c3cf890cc2d96f2093e2116612cbf65bfaeea.zip
Merge branch 'master' into Sync-weave
Diffstat (limited to 'netwerk/protocol/http/nsHttpChannel.cpp')
-rw-r--r--netwerk/protocol/http/nsHttpChannel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index bb0b3ca77..be5539a02 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -313,11 +313,15 @@ nsHttpChannel::nsHttpChannel()
, mPushedStream(nullptr)
, mLocalBlocklist(false)
, mWarningReporter(nullptr)
+ , mSendUpgradeRequest(false)
, mDidReval(false)
{
LOG(("Creating nsHttpChannel [this=%p]\n", this));
mChannelCreationTime = PR_Now();
mChannelCreationTimestamp = TimeStamp::Now();
+
+ mSendUpgradeRequest =
+ Preferences::GetBool("network.http.upgrade-insecure-requests", false);
}
nsHttpChannel::~nsHttpChannel()
@@ -377,8 +381,9 @@ nsHttpChannel::Connect()
mLoadInfo->GetExternalContentPolicyType() :
nsIContentPolicy::TYPE_OTHER;
- if (type == nsIContentPolicy::TYPE_DOCUMENT ||
- type == nsIContentPolicy::TYPE_SUBDOCUMENT) {
+ if (mSendUpgradeRequest &&
+ (type == nsIContentPolicy::TYPE_DOCUMENT ||
+ type == nsIContentPolicy::TYPE_SUBDOCUMENT)) {
rv = SetRequestHeader(NS_LITERAL_CSTRING("Upgrade-Insecure-Requests"),
NS_LITERAL_CSTRING("1"), false);
NS_ENSURE_SUCCESS(rv, rv);