Issue #2641 - Update Fetch to adhere to the updated spec (pass refpolicy)

Resolves #2641
This commit is contained in:
Moonchild 2024-10-20 11:23:30 +02:00 committed by roytam1
commit 7d978ccd71
16 changed files with 244 additions and 91 deletions

View file

@ -2434,9 +2434,10 @@ XMLHttpRequestMainThread::InitiateFetch(nsIInputStream* aUploadStream,
if (!IsSystemXHR()) {
nsCOMPtr<nsPIDOMWindowInner> owner = GetOwner();
nsCOMPtr<nsIDocument> doc = owner ? owner->GetExtantDoc() : nullptr;
mozilla::net::ReferrerPolicy referrerPolicy = doc ?
doc->GetReferrerPolicy() : mozilla::net::RP_Default;
nsContentUtils::SetFetchReferrerURIWithPolicy(mPrincipal, doc,
httpChannel,
mozilla::net::RP_Default);
httpChannel, referrerPolicy);
}
// Some extensions override the http protocol handler and provide their own