diff --git a/src/raccoonLog.Http/HttpMessageLogMiddleware.cs b/src/raccoonLog.Http/HttpMessageLogMiddleware.cs index fb3e76d..54c2092 100644 --- a/src/raccoonLog.Http/HttpMessageLogMiddleware.cs +++ b/src/raccoonLog.Http/HttpMessageLogMiddleware.cs @@ -18,9 +18,7 @@ public HttpMessageLogMiddleware(RequestDelegate next) public async Task Invoke(HttpContext context, IHttpLoggingProvider httpLogging) { - var ct = context.RequestAborted; - - await httpLogging.LogAsync(context.Request, ct); + await httpLogging.LogAsync(context.Request, context.RequestAborted); var originalBody = context.Response.Body; @@ -32,11 +30,11 @@ public async Task Invoke(HttpContext context, IHttpLoggingProvider httpLogging) await _next(context); - await httpLogging.LogAsync(context.Response, bodyStream, ct); + await httpLogging.LogAsync(context.Response, bodyStream, context.RequestAborted); bodyStream.Position = 0; - await bodyStream.CopyToAsync(originalBody, ct); + await bodyStream.CopyToAsync(originalBody, context.RequestAborted); context.Response.Body = originalBody; }