diff --git a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs index 6b559f4d3e..23fece372f 100644 --- a/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs +++ b/framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpAspNetCoreSignalRModule.cs @@ -7,6 +7,7 @@ using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.SignalR; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Auditing; using Volo.Abp.DependencyInjection; using Volo.Abp.Modularity; @@ -30,6 +31,7 @@ namespace Volo.Abp.AspNetCore.SignalR public override void ConfigureServices(ServiceConfigurationContext context) { + var routePatterns = new List {"/signalr-hubs"}; var signalRServerBuilder = context.Services.AddSignalR(); context.Services.ExecutePreConfiguredActions(signalRServerBuilder); @@ -45,6 +47,8 @@ namespace Volo.Abp.AspNetCore.SignalR foreach (var hubConfig in signalROptions.Hubs) { + routePatterns.AddIfNotContains(hubConfig.RoutePattern); + MapHubType( hubConfig.HubType, endpointContext.Endpoints, @@ -60,6 +64,14 @@ namespace Volo.Abp.AspNetCore.SignalR } }); }); + + Configure(options => + { + foreach (var routePattern in routePatterns) + { + options.IgnoredUrls.AddIfNotContains(x => routePattern.StartsWith(x), () => routePattern); + } + }); } private void AutoAddHubTypes(IServiceCollection services)