Skip to content

Commit

Permalink
Fixes logging output for intercepted requests. Closes #820 (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz authored Jul 8, 2024
1 parent fc6c0a1 commit 973fb13
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dev-proxy-plugins/RandomErrors/GenericRandomErrorPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ error.Headers is not null &&
{
session.GenericResponse(body, statusCode, headers.Select(h => new HttpHeader(h.Name, h.Value)));
}
e.ResponseState.HasBeenSet = true;
Logger.LogRequest([$"{error.StatusCode} {statusCode.ToString()}"], MessageType.Chaos, new LoggingContext(e.Session));
}

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

private Task OnRequest(object? sender, ProxyRequestArgs e)
{
var state = e.ResponseState;
if (!e.ResponseState.HasBeenSet
&& UrlsToWatch is not null
&& e.ShouldExecute(UrlsToWatch))
Expand All @@ -213,7 +213,6 @@ private Task OnRequest(object? sender, ProxyRequestArgs e)
return Task.CompletedTask;
}
FailResponse(e);
state.HasBeenSet = true;
}

return Task.CompletedTask;
Expand Down

0 comments on commit 973fb13

Please sign in to comment.