Skip to content

Commit c9a6f1d

Browse files
committed
♻️ harmonise platform names with other client libs
1 parent 78afdd4 commit c9a6f1d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/Mindee/ServiceCollectionsExtensions.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
using System;
2-
using System.Net;
32
using System.Net.Http.Headers;
43
using System.Reflection;
4+
using System.Runtime.InteropServices;
55
using Microsoft.Extensions.DependencyInjection;
6-
using Microsoft.Extensions.DependencyInjection.Extensions;
76
using Microsoft.Extensions.Options;
87
using Mindee.Http;
98
using Mindee.Pdf;
@@ -60,9 +59,18 @@ private static void RegisterRestSharpClient(IServiceCollection services, bool th
6059

6160
private static string BuildUserAgent()
6261
{
62+
string platform;
63+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
64+
platform = "windows";
65+
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
66+
platform = "linux";
67+
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
68+
platform = "macos";
69+
else
70+
platform = "other";
6371
return $"mindee-api-dotnet@v{Assembly.GetExecutingAssembly().GetName().Version}"
6472
+ $" dotnet-v{Environment.Version}"
65-
+ $" {Environment.OSVersion}";
73+
+ $" {platform}";
6674
}
6775

6876
/// <summary>

0 commit comments

Comments
 (0)