21 lines
551 B
C#
21 lines
551 B
C#
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.Extensions.Primitives;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DG.Core
|
|
{
|
|
public static class HttpExtensions
|
|
{
|
|
public static string GetCorrelationId(this HttpContext httpContext)
|
|
{
|
|
httpContext.Request.Headers.TryGetValue("Cko-Correlation-Id", out StringValues correlationId);
|
|
return correlationId.FirstOrDefault() ?? httpContext.TraceIdentifier;
|
|
}
|
|
}
|
|
}
|