pcut_uwp/PCUT/Http.Core/Handlers/DeviceAuthHandler.cs

20 lines
569 B
C#
Raw Normal View History

2024-08-21 16:02:56 +00:00
using Http.Core.Contexts;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Http.Core.Handlers
{
public class DeviceAuthHandler : DelegatingHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
request.Headers.Add("x-device-id", $"{UserContext.Instance.DeviceId}");
return base.SendAsync(request, cancellationToken);
}
}
}