From 325a128aa1a7ed05f6f3430cd3bd0d90dbf089d2 Mon Sep 17 00:00:00 2001 From: Renato Lima Date: Mon, 26 Aug 2024 23:24:13 -0200 Subject: [PATCH] Fix bug in chaos middleware breaking responses --- src/Mockaco.AspNetCore/Middlewares/ChaosMiddleware.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Mockaco.AspNetCore/Middlewares/ChaosMiddleware.cs b/src/Mockaco.AspNetCore/Middlewares/ChaosMiddleware.cs index 4cb4056..3540e9d 100644 --- a/src/Mockaco.AspNetCore/Middlewares/ChaosMiddleware.cs +++ b/src/Mockaco.AspNetCore/Middlewares/ChaosMiddleware.cs @@ -32,6 +32,7 @@ public async Task Invoke(HttpContext httpContext) { if (!_options.Value.Enabled) { + await _next(httpContext); return; } @@ -52,7 +53,6 @@ public async Task Invoke(HttpContext httpContext) if (httpContext.Response.StatusCode != (int)HttpStatusCode.OK) return; - await _next(httpContext); }