Browse Source

Merge pull request #17629 from abpframework/MapBlazorHub

Support configure the `HttpConnectionDispatcherOptions`.
pull/17630/head
maliming 3 years ago
committed by GitHub
parent
commit
152665d420
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs

10
framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs

@ -1,6 +1,8 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting.StaticWebAssets; using Microsoft.AspNetCore.Hosting.StaticWebAssets;
using Microsoft.AspNetCore.Http.Connections;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.FileProviders;
@ -48,11 +50,15 @@ public class AbpAspNetCoreComponentsServerModule : AbpModule
options.IgnoredUrls.AddIfNotContains("/_blazor"); options.IgnoredUrls.AddIfNotContains("/_blazor");
}); });
var preConfigureActions = context.Services.GetPreConfigureActions<HttpConnectionDispatcherOptions>();
Configure<AbpEndpointRouterOptions>(options => Configure<AbpEndpointRouterOptions>(options =>
{ {
options.EndpointConfigureActions.Add(endpointContext => options.EndpointConfigureActions.Add(endpointContext =>
{ {
endpointContext.Endpoints.MapBlazorHub(); endpointContext.Endpoints.MapBlazorHub(httpConnectionDispatcherOptions =>
{
preConfigureActions.Configure(httpConnectionDispatcherOptions);
});
endpointContext.Endpoints.MapFallbackToPage("/_Host"); endpointContext.Endpoints.MapFallbackToPage("/_Host");
}); });
}); });

Loading…
Cancel
Save