Browse Source
Merge pull request #17292 from abpframework/DefaultHomePageMiddleware
Check `Path.Value` first for better performance.
pull/17293/head
Enis Necipoglu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
4 additions and
5 deletions
-
modules/cms-kit/src/Volo.CmsKit.Public.Web/DefaultHomePageMiddleware.cs
|
|
|
@ -1,5 +1,4 @@ |
|
|
|
using System.Net; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Http; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
@ -16,9 +15,9 @@ public class DefaultHomePageMiddleware : IMiddleware, ITransientDependency |
|
|
|
{ |
|
|
|
var featureChecker = context.RequestServices.GetRequiredService<IFeatureChecker>(); |
|
|
|
|
|
|
|
if (await featureChecker.IsEnabledAsync(CmsKitFeatures.PageEnable)) |
|
|
|
if (context.Request.Path.Value == "/") |
|
|
|
{ |
|
|
|
if (context.Request.Path.Value == "/") |
|
|
|
if (await featureChecker.IsEnabledAsync(CmsKitFeatures.PageEnable)) |
|
|
|
{ |
|
|
|
var pagePublicAppService = context.RequestServices.GetRequiredService<IPagePublicAppService>(); |
|
|
|
|
|
|
|
@ -32,4 +31,4 @@ public class DefaultHomePageMiddleware : IMiddleware, ITransientDependency |
|
|
|
|
|
|
|
await next(context); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|