Skip to content

Commit f0396fb

Browse files
2 parents bf37852 + 1fe18af commit f0396fb

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

DriveClient/kDriveClient/KDriveClient.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ public KDriveClient(string token, long driveId, bool autoChunk, int parallelism,
9797
DriveId = driveId;
9898
Parallelism = parallelism;
9999
Logger = logger;
100+
string version = Assembly.GetEntryAssembly()?.GetName().Version?.ToString() ?? "unknown";
100101
HttpClient = httpClient ?? new HttpClient { BaseAddress = new Uri("https://api.infomaniak.com") };
101102
HttpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
103+
HttpClient.DefaultRequestHeaders.UserAgent(new ProductInfoHeaderValue("kDriveClient.NET", version));
102104
this.Logger?.LogInformation("KDriveClient initialized with Drive ID: {DriveId}", DriveId);
103105
if (autoChunk)
104106
{
@@ -161,4 +163,4 @@ private async Task<HttpResponseMessage> SendWithErrorHandlingAsync(HttpRequestMe
161163
return await KDriveJsonHelper.DeserializeResponseAsync(response, ct);
162164
}
163165
}
164-
}
166+
}

0 commit comments

Comments
 (0)