File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 8
8
9
9
namespace Ocelot . Authorization
10
10
{
11
- public class ClaimsAuthorizer : IClaimsAuthorizer
11
+ public partial class ClaimsAuthorizer : IClaimsAuthorizer
12
12
{
13
13
private readonly IClaimsParser _claimsParser ;
14
14
@@ -35,7 +35,7 @@ List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues
35
35
if ( values . Data != null )
36
36
{
37
37
// dynamic claim
38
- var match = Regex . Match ( required . Value , @"^{(?<variable>.+)}$" ) ;
38
+ var match = VariableRegex ( ) . Match ( required . Value ) ;
39
39
if ( match . Success )
40
40
{
41
41
var variableName = match . Captures [ 0 ] . Value ;
@@ -69,7 +69,7 @@ List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues
69
69
}
70
70
else
71
71
{
72
- //if required value is not specified
72
+ // if required value is not specified
73
73
if ( string . IsNullOrEmpty ( required . Value ) )
74
74
{
75
75
continue ;
@@ -92,5 +92,8 @@ List<PlaceholderNameAndValue> urlPathPlaceholderNameAndValues
92
92
93
93
return new OkResponse < bool > ( true ) ;
94
94
}
95
+
96
+ [ GeneratedRegex ( "^{(?<variable>.+)}$" ) ]
97
+ private static partial Regex VariableRegex ( ) ;
95
98
}
96
99
}
You can’t perform that action at this time.
0 commit comments