This commit is contained in:
Stef Heyenrath
2026-02-08 11:54:24 +01:00
parent 26354641a1
commit e47e5df734
3 changed files with 18 additions and 2 deletions

View File

@@ -28,6 +28,8 @@ using Next = Microsoft.Owin.OwinMiddleware;
using OwinMiddleware = System.Object;
using IContext = Microsoft.AspNetCore.Http.HttpContext;
using Next = Microsoft.AspNetCore.Http.RequestDelegate;
using HandlebarsDotNet;
using WireMock.Org.Abstractions;
#endif
namespace WireMock.Owin
@@ -169,6 +171,20 @@ namespace WireMock.Owin
return;
}
#if USE_ASPNETCORE && NET8_0_OR_GREATER
if (ctx.WebSockets.IsWebSocketRequest)
{
// Accept WebSocket upgrade
var webSocket = await ctx.WebSockets.AcceptWebSocketAsync();
// Get and invoke handler
var provider = targetMapping.Provider as WireMock.WebSockets.ResponseProviders.WebSocketResponseProvider;
await provider.HandleWebSocketAsync(webSocket, request);
return; // Don't process as HTTP
}
#endif
logRequest = targetMapping.LogMapping;
if (targetMapping.IsAdminInterface && _options.AuthenticationMatcher != null && request.Headers != null)