import changes from `dev' branch of rmottola/Arctic-Fox:

- namespace (9098f16503)
- Bug 1200337 - Part 1: Don't expose standard HTTP headers during interception in non-e10s mode, r=mcmanus (de66cfebfd)
- Bug 1200337 - Part 2: Add a Web Platform Test to check the visibility of default headers during interception, r=bkelly (7bc6a6da3a)
- Bug 1169772 - Add Android version to platform identifier of Fennec's UA string. r=mfinkle, r=gerv (dec38d4c25)
- code style (21d40d3b6b)
- Bug 1108183 - Regularize case of language subtags in Accept-Language header. r=mcmanus (cf10ae2cb2)
- Bug 1152897 - update Alt-Svc pref name and default r=hurley (bc3c5e998c)
- Bug 1198387 - Remove use-cache preference and its references. r=mcmanus (732b2552d0)
- Bug 1036275 - Change nsHttpChannel to call into PackagedAppService fo urls containing !// r=honzab (eba098a919)
- Bug 1199049 - Part 3: Add a CORS preflight result notification API; r=jduell,ckerschb,sicking (2f823319a2)
- Bug 1199049 - Part 4: Perform CORS preflights from nsHttpChannel before connecting to the network; r=jduell,ckerschb,sicking (b87f957b19)
- Bug 1199049 - Part 5: Preserve the CORS preflight information when setting up a replacement channel; r=jduell (0ff5213af9)
- Bug 1199049 - Part 6: Transfer the preflight parameters to the parent process in e10s mode; r=jduell (6ed48d9512)
- Bug 1199049 - Part 7: Remove entries from the CORS preflight cache in the parent process when a CORS check in the child process fails; r=jduell (f0cf6759f3)
- Bug 1199049 - Part 8: Use Necko-level CORS preflights in fetch; r=jdm (8b91e8c6fa)
- Bug 1199049 - Part 9: Use Necko-level CORS preflights in XHR; r=jdm (a48e71430a)
- Bug 1199049 - Part 10: Use Necko-level CORS preflights in sendBeacon; r=jdm (9fb3aaad6d)
- Bug 1199049 - Part 11: Make it impossible to start CORS preflights from outside of Necko; r=jduell,ckerschb,sicking (5a371e2cd2)
- Bug 1199049 - Part 12: Move the calls on the listener object to OnPreflightFailed(); r=jduell (2119233974)
- Bug 1199049 - Part 13: Cancel the preflight channel if the original channel gets canceled when a CORS preflight is in progress; r=jduell,sicking (59df760454)
- Bug 1199049 - Part 14: Cancel the original channel in case a CORS preflight fails using AsyncAbort(); r=jduell (4e6afdfe41)
- Bug 1199049 - Part 15: Add a missing include (d881400b2a)
- Bug 1206084 Always Cancel() channel in nsCORSListenerProxy for failed redirects. r=ehsan (d31d4e4e35)
This commit is contained in:
2022-03-31 10:46:28 +08:00
parent 359792367d
commit e76a0e8c24
34 changed files with 777 additions and 181 deletions
+8 -7
View File
@@ -604,18 +604,19 @@ FetchDriver::HttpFetch(bool aCORSFlag, bool aCORSPreflightFlag, bool aAuthentica
if (aCORSPreflightFlag) {
MOZ_ASSERT(mRequest->Mode() != RequestMode::No_cors,
"FetchDriver::ContinueFetch() should ensure that the request is not no-cors");
nsCOMPtr<nsIChannel> preflightChannel;
MOZ_ASSERT(httpChan, "CORS preflight can only be used with HTTP channels");
nsAutoTArray<nsCString, 5> unsafeHeaders;
mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders);
rv = NS_StartCORSPreflight(chan, listener, mPrincipal,
useCredentials,
unsafeHeaders,
getter_AddRefs(preflightChannel));
} else {
rv = chan->AsyncOpen(listener, nullptr);
nsCOMPtr<nsIHttpChannelInternal> internalChan = do_QueryInterface(httpChan);
rv = internalChan->SetCorsPreflightParameters(unsafeHeaders, useCredentials, mPrincipal);
if (NS_WARN_IF(NS_FAILED(rv))) {
return FailWithNetworkError();
}
}
rv = chan->AsyncOpen(listener, nullptr);
if (NS_WARN_IF(NS_FAILED(rv))) {
return FailWithNetworkError();
}