Skip to content

Commit 53739b8

Browse files
committed
Don't skip admin requests
1 parent 197d658 commit 53739b8

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

src/OrchardCoreContrib.Ban/IPBanMiddleware.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
using Microsoft.AspNetCore.Diagnostics;
22
using Microsoft.AspNetCore.Http;
33
using Microsoft.Extensions.Logging;
4-
using Microsoft.Extensions.Options;
5-
using OrchardCore.Admin;
64
using OrchardCoreContrib.Ban.Services;
75

86
namespace OrchardCoreContrib.Ban;
97

108
public class IPBanMiddleware(
119
RequestDelegate next,
1210
IIPBanService ipBanService,
13-
IOptions<AdminOptions> adminOptions,
1411
ILogger<IPBanMiddleware> logger)
1512
{
1613
public async Task InvokeAsync(HttpContext context)
@@ -24,13 +21,6 @@ public async Task InvokeAsync(HttpContext context)
2421
return;
2522
}
2623

27-
// Skip admin requests
28-
if (context.Request.Path.StartsWithSegments($"/{adminOptions.Value.AdminUrlPrefix}"))
29-
{
30-
await next(context);
31-
32-
return;
33-
}
3424

3525
var ip = context.Connection.RemoteIpAddress;
3626
if (await ipBanService.IsBannedAsync(ip))

0 commit comments

Comments
 (0)