Пример #1
0
        private void SetCorrelationId(HttpContext context, CorrelationIdOptions options, string correlationId)
        {
            if (context.Response.HasStarted)
            {
                return;
            }

            if (!options.SetResponseHeader)
            {
                return;
            }

            if (context.Response.Headers.ContainsKey(options.HttpHeaderName))
            {
                return;
            }

            context.Response.Headers[options.HttpHeaderName] = correlationId;
        }
Пример #2
0
 public CorrelationIdMiddleware(ICorrelationIdProvider correlationIdProvider, IOptions <CorrelationIdOptions> options)
 {
     _correlationIdProvider = correlationIdProvider;
     _options = options.Value;
 }