Skip to content

Commit

Permalink
fix: User agent generation on Mac and Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
peasee committed Sep 21, 2024
1 parent 20566eb commit 9046645
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Spice/src/Config/UserAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ public static string agent()
var osType = os.Platform;
var osVersion = os.VersionString;
osVersion = osVersion.Replace($"{osType} ", ""); // remove osType from version
if (osType == PlatformID.Win32NT)
{
osVersion = osVersion.Replace("Microsoft Windows NT ", ""); // remove "Microsoft Windows NT " from version
}

var osArch = System.Runtime.InteropServices.RuntimeInformation.OSArchitecture;

var osArchStr = "unknown";
Expand All @@ -47,7 +52,7 @@ public static string agent()
osArchStr = "arm";
break;
case System.Runtime.InteropServices.Architecture.Arm64:
osArchStr = "arm64";
osArchStr = "aarch64";
break;
}

Expand Down

0 comments on commit 9046645

Please sign in to comment.