Update AbpCorrelationIdMiddleware.cs

pull/17224/head
maliming 2 years ago committed by GitHub
parent 21e899b8bd
commit 570209818d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -29,6 +29,18 @@ public class AbpCorrelationIdMiddleware : IMiddleware, ITransientDependency
}
}
protected virtual string GetCorrelationIdFromRequest(HttpContext context)
{
string correlationId = context.Request.Headers[_options.HttpHeaderName];
if (correlationId.IsNullOrEmpty())
{
correlationId = Guid.NewGuid().ToString("N");
context.Request.Headers[_options.HttpHeaderName] = correlationId;
}
return correlationId;
}
protected virtual void CheckAndSetCorrelationIdOnResponse(
HttpContext httpContext,
AbpCorrelationIdOptions options,

Loading…
Cancel
Save