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
parent bd2da4da67
commit 37143d714a
4 changed files with 16 additions and 1 deletions

View File

@@ -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);

View File

@@ -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.

View File

@@ -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
};

View File

@@ -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) {