Add project files.

This commit is contained in:
Sergio Matias Urquin
2025-04-29 18:37:40 -06:00
parent ef5b7ed2ca
commit dacb004ae9
43 changed files with 1432 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Http;
namespace Core.Blueprint.External
{
public sealed class TrackingMechanismExtension(IHttpContextAccessor httpContextAccessor) : DelegatingHandler
{
private readonly IHttpContextAccessor _httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor));
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
if (_httpContextAccessor.HttpContext != null)
{
request.Headers.Add("TrackingId", Guid.NewGuid().ToString());
}
return await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
}
}
}