mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-10 15:25:42 -07:00
Update HttpClient user agent format
TIL user agents have a specific syntax lol
This commit is contained in:
parent
43ab5626ee
commit
84da94c3f2
@ -141,10 +141,22 @@ namespace Bloxstrap
|
||||
|
||||
Logger.WriteLine(LOG_IDENT, $"Starting {ProjectName} v{Version}");
|
||||
|
||||
string userAgent = $"{ProjectName}/{Version}";
|
||||
|
||||
if (IsActionBuild)
|
||||
{
|
||||
Logger.WriteLine(LOG_IDENT, $"Compiled {BuildMetadata.Timestamp.ToFriendlyString()} from commit {BuildMetadata.CommitHash} ({BuildMetadata.CommitRef})");
|
||||
|
||||
if (IsProductionBuild)
|
||||
userAgent += $" (Production)";
|
||||
else
|
||||
userAgent += $" (Artifact {BuildMetadata.CommitHash}, {BuildMetadata.CommitRef})";
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.WriteLine(LOG_IDENT, $"Compiled {BuildMetadata.Timestamp.ToFriendlyString()} from {BuildMetadata.Machine}");
|
||||
userAgent += $" (Build {BuildMetadata.Machine})";
|
||||
}
|
||||
|
||||
Logger.WriteLine(LOG_IDENT, $"Loaded from {Paths.Process}");
|
||||
|
||||
@ -153,7 +165,7 @@ namespace Bloxstrap
|
||||
ApplicationConfiguration.Initialize();
|
||||
|
||||
HttpClient.Timeout = TimeSpan.FromSeconds(30);
|
||||
HttpClient.DefaultRequestHeaders.Add("User-Agent", ProjectRepository);
|
||||
HttpClient.DefaultRequestHeaders.Add("User-Agent", userAgent);
|
||||
|
||||
LaunchSettings = new LaunchSettings(e.Args);
|
||||
|
||||
|
@ -1009,7 +1009,7 @@ namespace Bloxstrap
|
||||
|
||||
if (ex.GetType() == typeof(ChecksumFailedException))
|
||||
{
|
||||
_ = App.HttpClient.GetAsync($"http://bloxstraplabs.com/metrics/post?key=packageDownloadState&value=httpFail");
|
||||
_ = App.HttpClient.GetAsync($"https://bloxstraplabs.com/metrics/post?key=packageDownloadState&value=httpFail");
|
||||
|
||||
Frontend.ShowConnectivityDialog(
|
||||
Strings.Dialog_Connectivity_UnableToDownload,
|
||||
@ -1044,7 +1044,7 @@ namespace Bloxstrap
|
||||
if (statIsRetrying)
|
||||
{
|
||||
string stat = statIsHttp ? "httpSuccess" : "retrySuccess";
|
||||
_ = App.HttpClient.GetAsync($"http://bloxstraplabs.com/metrics/post?key=packageDownloadState&value={stat}");
|
||||
_ = App.HttpClient.GetAsync($"https://bloxstraplabs.com/metrics/post?key=packageDownloadState&value={stat}");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,5 @@
|
||||
public static class GlobalCache
|
||||
{
|
||||
public static readonly Dictionary<string, string?> ServerLocation = new();
|
||||
|
||||
public static readonly Dictionary<long, ThumbnailResponse> UserThumbnails = new();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user