Skip to content

Commit b8b05f1

Browse files
Fixes bug with the OpenAIMockResponsePlugin trying to update set response
1 parent 9ad2b48 commit b8b05f1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dev-proxy-plugins/Mocks/OpenAIMockResponsePlugin.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,13 @@ public override async Task RegisterAsync()
3434

3535
private async Task OnRequestAsync(object sender, ProxyRequestArgs e)
3636
{
37+
if (e.ResponseState.HasBeenSet)
38+
{
39+
Logger.LogRequest("Response already set", MessageType.Skipped, new LoggingContext(e.Session));
40+
return;
41+
}
3742
if (UrlsToWatch is null ||
38-
!e.HasRequestUrlMatch(UrlsToWatch))
43+
!e.ShouldExecute(UrlsToWatch))
3944
{
4045
Logger.LogRequest("URL not matched", MessageType.Skipped, new LoggingContext(e.Session));
4146
return;

0 commit comments

Comments
 (0)