mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 07:04:27 +00:00
Include GUID in user-agent
This commit is contained in:
parent
9bfd26a3d8
commit
4b226b8569
2 changed files with 2 additions and 1 deletions
|
@ -55,6 +55,7 @@ namespace ArchiSteamFarm {
|
|||
|
||||
internal static string HomeDirectory => Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
|
||||
internal static Guid ModuleVersion => Assembly.GetEntryAssembly().ManifestModule.ModuleVersionId;
|
||||
internal static string PrivateIdentifier => PublicIdentifier + "-" + (Program.GlobalDatabase?.Guid.ToString("N") ?? Guid.NewGuid().ToString("N"));
|
||||
internal static string PublicIdentifier => AssemblyName + (BuildInfo.IsCustomBuild ? "-custom" : "");
|
||||
internal static Version Version => Assembly.GetEntryAssembly().GetName().Version;
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace ArchiSteamFarm {
|
|||
|
||||
// Most web services expect that UserAgent is set, so we declare it globally
|
||||
// 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 + ")");
|
||||
HttpClient.DefaultRequestHeaders.UserAgent.ParseAdd(SharedInfo.PrivateIdentifier + "/" + SharedInfo.Version + " (+" + SharedInfo.ProjectURL + ")");
|
||||
}
|
||||
|
||||
public void Dispose() => HttpClient.Dispose();
|
||||
|
|
Loading…
Reference in a new issue