mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 20:57:22 +01:00
add mare version to http client headers
This commit is contained in:
parent
4b278bd456
commit
d5f140a142
2 changed files with 7 additions and 0 deletions
|
|
@ -14,6 +14,8 @@ using MareSynchronos.Services.ServerConfiguration;
|
|||
using MareSynchronos.Services;
|
||||
using MareSynchronos.API.Data.Extensions;
|
||||
using MareSynchronos.API.Data;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http;
|
||||
|
||||
namespace MareSynchronos.WebAPI;
|
||||
|
||||
|
|
@ -138,6 +140,8 @@ public sealed partial class ApiController : DisposableMediatorSubscriberBase, IM
|
|||
{
|
||||
Logger.LogDebug("Requesting new JWT");
|
||||
using HttpClient httpClient = new();
|
||||
var ver = Assembly.GetExecutingAssembly().GetName().Version;
|
||||
httpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue("MareSynchronos", ver!.Major + "." + ver!.Minor + "." + ver!.Build));
|
||||
var postUri = MareAuth.AuthFullPath(new Uri(_serverManager.CurrentApiUrl
|
||||
.Replace("wss://", "https://", StringComparison.OrdinalIgnoreCase)
|
||||
.Replace("ws://", "http://", StringComparison.OrdinalIgnoreCase)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue