Skip to content

Commit 644b8b4

Browse files
Merge branch 'main' into crudapi-cors2
2 parents 8724ca4 + 97bf41e commit 644b8b4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

dev-proxy-plugins/Mocks/CrudApiPlugin.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ private void AddCORSHeaders(Request request, List<HttpHeader> headers)
218218

219219
headers.Add(new HttpHeader("access-control-allow-origin", origin));
220220

221-
if (_configuration.EntraAuthConfig is not null)
221+
if (_configuration.EntraAuthConfig is not null ||
222+
_configuration.Actions.Any(a => a.Auth == CrudApiAuthType.Entra))
222223
{
223224
headers.Add(new HttpHeader("access-control-allow-headers", "authorization, content-type"));
224225
}

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)