using System.Reflection; namespace Cleanuparr.Shared.Helpers; /// /// The User-Agent product token, shaped per RFC 9110. /// public static class AppUserAgent { private const string ProductName = "Cleanuparr"; /// /// The User-Agent value for the running build. /// Reads "Cleanuparr/1.2.3" on a tagged release. /// public static readonly string Value = Format(Assembly.GetEntryAssembly()?.GetName().Version); internal static string Format(Version? version) => version is null ? ProductName : $"{ProductName}/{version.Major}.{version.Minor}.{Math.Max(version.Build, 0)}"; }