Skip to content

Commit 960ffe3

Browse files
committed
Properly qualify (prefix server endpoint URL + /) the request URI for logs
1 parent 226b6dc commit 960ffe3

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/Client/UpdateClient/UpdateClient.Admin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public partial class UpdateClient
1818
{
1919
if (!_config.CanUseAdminEndpoints)
2020
{
21-
Log("Cannot use {0} endpoint, as there is no configured admin access token.", [nameof(RefreshVersionCacheAsync)]);
21+
Log("Cannot request cache refresh, as there is no configured admin access token.");
2222
return null;
2323
}
2424

src/Client/UpdateClient/UpdateClient.Download.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public partial class UpdateClient
2828
$"&rc={rc.AsQueryStringValue()}" +
2929
$"&version={version}";
3030

31-
Log("Downloading the file from: {0}", [url]);
31+
Log("Downloading the file from: {0}", [QualifyUriPath(url)]);
3232

3333
var resp = await _http.GetAsync(url);
3434

src/Client/UpdateClient/UpdateClient.Latest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public partial class UpdateClient
2727
$"&arch={arch.AsQueryStringValue()}" +
2828
$"&rc={rc.AsQueryStringValue()}";
2929

30-
Log("Checking for updates from: {0}", [url]);
30+
Log("Checking for updates from: {0}", [QualifyUriPath(url)]);
3131

3232
var resp = await _http.GetAsync(url);
3333

src/Client/UpdateClient/UpdateClient.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ void IDisposable.Dispose()
3434
_http.Dispose();
3535
GC.SuppressFinalize(this);
3636
}
37+
38+
private string QualifyUriPath(string path) => $"{_config.ServerEndpoint.TrimEnd('/')}/{path}";
3739

38-
private void Log(string format, IEnumerable<object> args, [CallerMemberName] string caller = null!)
39-
=> _config.Logger(format, args.ToArray(), caller);
40+
private void Log(string format, IEnumerable<object>? args = null, [CallerMemberName] string caller = null!)
41+
=> _config.Logger(format, args?.ToArray() ?? [], caller);
4042

4143
private void ApplyAuthorization(HttpRequestMessage httpRequest)
4244
{

0 commit comments

Comments
 (0)