mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-17 22:50:05 +02:00
.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user