File tree Expand file tree Collapse file tree
src/OrchardCoreContrib.Ban Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using Microsoft . AspNetCore . Diagnostics ;
22using Microsoft . AspNetCore . Http ;
33using Microsoft . Extensions . Logging ;
4- using Microsoft . Extensions . Options ;
5- using OrchardCore . Admin ;
64using OrchardCoreContrib . Ban . Services ;
75
86namespace OrchardCoreContrib . Ban ;
97
108public 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 ) )
You can’t perform that action at this time.
0 commit comments