1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-05-26 13:58:49 +00:00

Revert incorrect UAO optimization that broke SSUAO

This commit is contained in:
JustOff
2018-05-15 00:32:07 +03:00
committed by Roy Tam
parent 3f5f572bde
commit 0aeb4a7e15
8 changed files with 4 additions and 89 deletions
-46
View File
@@ -6031,8 +6031,6 @@ nsHttpChannel::BeginConnect()
// notify "http-on-modify-request" observers
CallOnModifyRequestObservers();
SetLoadGroupUserAgentOverride();
// Check if request was cancelled during on-modify-request or on-useragent.
if (mCanceled) {
return mStatus;
@@ -8399,50 +8397,6 @@ nsHttpChannel::MaybeWarnAboutAppCache()
}
}
void
nsHttpChannel::SetLoadGroupUserAgentOverride()
{
nsCOMPtr<nsIURI> uri;
GetURI(getter_AddRefs(uri));
nsAutoCString uriScheme;
if (uri) {
uri->GetScheme(uriScheme);
}
// We don't need a UA for file: protocols.
if (uriScheme.EqualsLiteral("file")) {
gHttpHandler->OnUserAgentRequest(this);
return;
}
nsIRequestContextService* rcsvc = gHttpHandler->GetRequestContextService();
nsCOMPtr<nsIRequestContext> rc;
if (rcsvc) {
rcsvc->GetRequestContext(mRequestContextID,
getter_AddRefs(rc));
}
nsAutoCString ua;
if (nsContentUtils::IsNonSubresourceRequest(this)) {
gHttpHandler->OnUserAgentRequest(this);
if (rc) {
GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
rc->SetUserAgentOverride(ua);
}
} else {
GetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua);
// Don't overwrite the UA if it is already set (eg by an XHR with explicit UA).
if (ua.IsEmpty()) {
if (rc) {
rc->GetUserAgentOverride(ua);
SetRequestHeader(NS_LITERAL_CSTRING("User-Agent"), ua, false);
} else {
gHttpHandler->OnUserAgentRequest(this);
}
}
}
}
void
nsHttpChannel::SetDoNotTrack()
{