File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
framework/src/Bing.AspNetCore/Bing/AspNetCore/Logs
modules/admin/src/Bing.Admin/Modules Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 55using System . Linq ;
66using System . Text ;
77using System . Threading . Tasks ;
8+ using Bing . Helpers ;
89using Microsoft . AspNetCore . Http ;
910using Microsoft . Extensions . DependencyInjection ;
1011using Microsoft . Extensions . Options ;
@@ -276,6 +277,13 @@ private bool FilterRequest(HttpContext context)
276277 // 过滤请求数据
277278 if ( _options . RequestFilter == null || _options . RequestFilter . Count == 0 )
278279 return false ;
280+ // 请求路径 - 规则匹配
281+ var path = context . Request . Path . Value . ToLowerInvariant ( ) ;
282+ foreach ( var item in _options . RequestFilter )
283+ {
284+ if ( FastPathMatcher . Match ( item , path ) )
285+ return true ;
286+ }
279287 return false ;
280288 }
281289 }
Original file line number Diff line number Diff line change @@ -79,6 +79,8 @@ public override IServiceCollection AddServices(IServiceCollection services)
7979 {
8080 o . IsEnabled = true ;
8181 o . Name = "Bing.Admin" ;
82+ o . RequestFilter . Add ( "/swagger/**" ) ;
83+ o . RequestFilter . Add ( "/swagger" ) ;
8284 } ) ;
8385 return services ;
8486 }
Original file line number Diff line number Diff line change 22 <PropertyGroup >
33 <!-- All Microsoft packages -->
44 <MicrosoftPackageVersion >3.1.*</MicrosoftPackageVersion >
5- <BingUtilsPackageVersion >1.4.0-preview-20220830-1 </BingUtilsPackageVersion >
5+ <BingUtilsPackageVersion >1.4.0-preview-20220831-2 </BingUtilsPackageVersion >
66 <FreeSQLPackageVersion >3.2.610</FreeSQLPackageVersion >
77 </PropertyGroup >
88</Project >
You can’t perform that action at this time.
0 commit comments