network: follow-up rev 914569c0b (rework)

This commit is contained in:
roytam1 2024-07-09 11:35:15 +08:00
commit f8c34e7c0a

View file

@ -355,9 +355,13 @@ nsHttpHandler::Init()
} else { } else {
mProductSub.AssignLiteral(MOZILLA_UAVERSION); mProductSub.AssignLiteral(MOZILLA_UAVERSION);
} }
} else {
if (mCompatPlatformEnabled) {
mProductSub.Assign(mCompatPlatformVersion);
} else { } else {
mProductSub.Assign(mAppBuildID); mProductSub.Assign(mAppBuildID);
} }
}
// In case MOZILLA_UAVERSION is empty for some odd reason... // In case MOZILLA_UAVERSION is empty for some odd reason...
if (mProductSub.IsEmpty()) { if (mProductSub.IsEmpty()) {
mProductSub.Assign(mAppBuildID); mProductSub.Assign(mAppBuildID);
@ -990,10 +994,18 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
} }
if (mCompatGeckoEnabled) { if (mCompatGeckoEnabled) {
if (mCompatPlatformEnabled) {
mProductSub.Assign(mCompatPlatformVersion);
} else {
mProductSub.AssignLiteral(MOZILLA_UAVERSION); mProductSub.AssignLiteral(MOZILLA_UAVERSION);
}
} else {
if (mCompatPlatformEnabled) {
mProductSub.Assign(mCompatPlatformVersion);
} else { } else {
mProductSub.Assign(mAppBuildID); mProductSub.Assign(mAppBuildID);
} }
}
// In case MOZILLA_UAVERSION is empty for some odd reason... // In case MOZILLA_UAVERSION is empty for some odd reason...
if (mProductSub.IsEmpty()) { if (mProductSub.IsEmpty()) {
mProductSub.Assign(mAppBuildID); mProductSub.Assign(mAppBuildID);
@ -1018,9 +1030,13 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
mMisc.AssignLiteral("rv:"); mMisc.AssignLiteral("rv:");
if (mCompatGeckoEnabled) { if (mCompatGeckoEnabled) {
mMisc += mCompatFirefoxVersion; mMisc += mCompatFirefoxVersion;
} else {
if (mCompatPlatformEnabled) {
mMisc += mCompatPlatformVersion;
} else { } else {
mMisc += MOZILLA_UAVERSION; mMisc += MOZILLA_UAVERSION;
} }
}
mCompatFirefox.AssignLiteral("Firefox/"); mCompatFirefox.AssignLiteral("Firefox/");
mCompatFirefox += mCompatFirefoxVersion; mCompatFirefox += mCompatFirefoxVersion;