Skip to content

Commit 973fb13

Browse files
Fixes logging output for intercepted requests. Closes #820 (#821)
1 parent fc6c0a1 commit 973fb13

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

dev-proxy-plugins/RandomErrors/GenericRandomErrorPlugin.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ error.Headers is not null &&
175175
{
176176
session.GenericResponse(body, statusCode, headers.Select(h => new HttpHeader(h.Name, h.Value)));
177177
}
178+
e.ResponseState.HasBeenSet = true;
178179
Logger.LogRequest([$"{error.StatusCode} {statusCode.ToString()}"], MessageType.Chaos, new LoggingContext(e.Session));
179180
}
180181

@@ -201,7 +202,6 @@ private void OnInit(object? sender, InitArgs e)
201202

202203
private Task OnRequest(object? sender, ProxyRequestArgs e)
203204
{
204-
var state = e.ResponseState;
205205
if (!e.ResponseState.HasBeenSet
206206
&& UrlsToWatch is not null
207207
&& e.ShouldExecute(UrlsToWatch))
@@ -213,7 +213,6 @@ private Task OnRequest(object? sender, ProxyRequestArgs e)
213213
return Task.CompletedTask;
214214
}
215215
FailResponse(e);
216-
state.HasBeenSet = true;
217216
}
218217

219218
return Task.CompletedTask;

0 commit comments

Comments
 (0)