Bug 1809518 - Special case the HTTPS Only timeout request to make it bypass ORB r=farre,necko-reviewers

This particular request is used to identify the potential timeout issue
for HTTPS only requests. ORB doesn't need to block this request.

Differential Revision: https://phabricator.services.mozilla.com/D170251
This commit is contained in:
Sean Feng 2023-02-28 19:46:11 +00:00
Родитель 84f1835811
Коммит 27084394a5
4 изменённых файлов: 16 добавлений и 1 удалений

Просмотреть файл

@ -1033,7 +1033,8 @@ TestHTTPAnswerRunnable::Notify(nsITimer* aTimer) {
nsCOMPtr<nsILoadInfo> loadInfo = testHTTPChannel->LoadInfo();
uint32_t httpsOnlyStatus = loadInfo->GetHttpsOnlyStatus();
httpsOnlyStatus |= nsILoadInfo::HTTPS_ONLY_EXEMPT |
nsILoadInfo::HTTPS_ONLY_DO_NOT_LOG_TO_CONSOLE;
nsILoadInfo::HTTPS_ONLY_DO_NOT_LOG_TO_CONSOLE |
nsILoadInfo::HTTPS_ONLY_BYPASS_ORB;
loadInfo->SetHttpsOnlyStatus(httpsOnlyStatus);
testHTTPChannel->SetNotificationCallbacks(this);

Просмотреть файл

@ -500,6 +500,11 @@ interface nsILoadInfo : nsISupports
*/
const unsigned long HTTPS_ONLY_UPGRADED_HTTPS_FIRST = (1 << 7);
/**
* This flag indicates that the request should not be blocked by ORB.
*/
const unsigned long HTTPS_ONLY_BYPASS_ORB = (1 << 8);
/**
* Upgrade state of HTTPS-Only Mode. The flag HTTPS_ONLY_EXEMPT can get
* set on requests that should be excempt from an upgrade.

Просмотреть файл

@ -335,4 +335,7 @@ interface nsIRequest : nsISupports
* effect.
*/
const unsigned long LOAD_FRESH_CONNECTION = 1 << 15;
// Note that all flags are taken, the rest of the flags
// are located in nsIChannel and nsICachingChannel
};

Просмотреть файл

@ -3086,6 +3086,12 @@ bool HttpBaseChannel::ShouldBlockOpaqueResponse() const {
}
}
uint32_t httpsOnlyStatus = mLoadInfo->GetHttpsOnlyStatus();
if (httpsOnlyStatus & nsILoadInfo::HTTPS_ONLY_BYPASS_ORB) {
LOGORB("No block: HTTPS_ONLY_BYPASS_ORB");
return false;
}
bool isInDevToolsContext;
mLoadInfo->GetIsInDevToolsContext(&isInDevToolsContext);
if (isInDevToolsContext) {