mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Include project link in default user-agent
This commit is contained in:
@@ -43,6 +43,7 @@ namespace ArchiSteamFarm {
|
||||
internal const string KeysUsedExtension = ".used";
|
||||
internal const string LogFile = "log.txt";
|
||||
internal const string MobileAuthenticatorExtension = ".maFile";
|
||||
internal const string ProjectURL = "https://github.com/" + GithubRepo;
|
||||
internal const string SentryHashExtension = ".bin";
|
||||
internal const string StatisticsServer = "asf.justarchi.net";
|
||||
internal const string UlongCompatibilityStringPrefix = "s_";
|
||||
@@ -87,4 +88,4 @@ namespace ArchiSteamFarm {
|
||||
internal static bool IsCustomBuild => Variant == SourceVariant;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,8 @@ namespace ArchiSteamFarm {
|
||||
HttpClient = new HttpClient(httpClientHandler) { Timeout = TimeSpan.FromSeconds(extendedTimeout ? ExtendedTimeoutMultiplier * Program.GlobalConfig.ConnectionTimeout : Program.GlobalConfig.ConnectionTimeout) };
|
||||
|
||||
// Most web services expect that UserAgent is set, so we declare it globally
|
||||
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd(SharedInfo.PublicIdentifier + "/" + SharedInfo.Version);
|
||||
// If you by any chance came here with a very "clever" idea of changing default ASF user-agent then here is a very good advice from me: don't, for your own safety - you've been warned
|
||||
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd(SharedInfo.PublicIdentifier + "/" + SharedInfo.Version + " (+" + SharedInfo.ProjectURL + ")");
|
||||
}
|
||||
|
||||
public void Dispose() => HttpClient.Dispose();
|
||||
@@ -549,4 +550,4 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user