Skip to content

Commit d9f32d8

Browse files
feat(client): send User-Agent header
1 parent c17450e commit d9f32d8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Orb/Core/ParamsBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ static ParamsBase()
1919
var runtime = GetRuntime();
2020
s_defaultHeaders = new Dictionary<string, string>
2121
{
22+
["User-Agent"] = GetUserAgent(),
2223
["X-Stainless-Arch"] = GetOSArch(),
2324
["X-Stainless-Lang"] = "csharp",
2425
["X-Stainless-OS"] = GetOS(),
@@ -190,6 +191,8 @@ protected static void AddDefaultHeaders(HttpRequestMessage request, ClientOption
190191
}
191192
}
192193

194+
static string GetUserAgent() => $"{typeof(OrbClient).Name}/C# {GetPackageVersion()}";
195+
193196
static string GetOSArch() =>
194197
RuntimeInformation.OSArchitecture switch
195198
{

0 commit comments

Comments
 (0)