mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 00:08:39 +09:00
#863 Part 1: Make sending of http upgrade-insecure-requests optional
Defaults to false if not configured.
This commit is contained in:
parent
e53942ffe8
commit
a56a6ca1d1
2 changed files with 11 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue