@@ -37,7 +37,7 @@ import { HeaderMatcher__Output } from './generated/envoy/config/route/v3/HeaderM
37
37
import ConfigSelector = experimental . ConfigSelector ;
38
38
import LoadBalancingConfig = experimental . LoadBalancingConfig ;
39
39
import { XdsClusterManagerLoadBalancingConfig } from './load-balancer-xds-cluster-manager' ;
40
- import { ExactValueMatcher , FullMatcher , HeaderMatcher , Matcher , PathExactValueMatcher , PathPrefixValueMatcher , PathSafeRegexValueMatcher , PrefixValueMatcher , PresentValueMatcher , RangeValueMatcher , RejectValueMatcher , SafeRegexValueMatcher , SuffixValueMatcher , ValueMatcher } from './matcher' ;
40
+ import { ContainsValueMatcher , ExactValueMatcher , FullMatcher , HeaderMatcher , Matcher , PathExactValueMatcher , PathPrefixValueMatcher , PathSafeRegexValueMatcher , PrefixValueMatcher , PresentValueMatcher , RangeValueMatcher , RejectValueMatcher , SafeRegexValueMatcher , SuffixValueMatcher , ValueMatcher } from './matcher' ;
41
41
import { envoyFractionToFraction , Fraction } from "./fraction" ;
42
42
import { RouteAction , SingleClusterRouteAction , WeightedCluster , WeightedClusterRouteAction } from './route-action' ;
43
43
import { decodeSingleResource , HTTP_CONNECTION_MANGER_TYPE_URL } from './resources' ;
@@ -136,7 +136,7 @@ function getPredicateForHeaderMatcher(headerMatch: HeaderMatcher__Output): Match
136
136
let valueChecker : ValueMatcher ;
137
137
switch ( headerMatch . header_match_specifier ) {
138
138
case 'exact_match' :
139
- valueChecker = new ExactValueMatcher ( headerMatch . exact_match ! ) ;
139
+ valueChecker = new ExactValueMatcher ( headerMatch . exact_match ! , false ) ;
140
140
break ;
141
141
case 'safe_regex_match' :
142
142
valueChecker = new SafeRegexValueMatcher ( headerMatch . safe_regex_match ! . regex ) ;
@@ -150,10 +150,30 @@ function getPredicateForHeaderMatcher(headerMatch: HeaderMatcher__Output): Match
150
150
valueChecker = new PresentValueMatcher ( ) ;
151
151
break ;
152
152
case 'prefix_match' :
153
- valueChecker = new PrefixValueMatcher ( headerMatch . prefix_match ! ) ;
153
+ valueChecker = new PrefixValueMatcher ( headerMatch . prefix_match ! , false ) ;
154
154
break ;
155
155
case 'suffix_match' :
156
- valueChecker = new SuffixValueMatcher ( headerMatch . suffix_match ! ) ;
156
+ valueChecker = new SuffixValueMatcher ( headerMatch . suffix_match ! , false ) ;
157
+ break ;
158
+ case 'string_match' :
159
+ const stringMatch = headerMatch . string_match !
160
+ switch ( stringMatch . match_pattern ) {
161
+ case 'exact' :
162
+ valueChecker = new ExactValueMatcher ( stringMatch . exact ! , stringMatch . ignore_case ) ;
163
+ break ;
164
+ case 'safe_regex' :
165
+ valueChecker = new SafeRegexValueMatcher ( stringMatch . safe_regex ! . regex ) ;
166
+ break ;
167
+ case 'prefix' :
168
+ valueChecker = new PrefixValueMatcher ( stringMatch . prefix ! , stringMatch . ignore_case ) ;
169
+ break ;
170
+ case 'suffix' :
171
+ valueChecker = new SuffixValueMatcher ( stringMatch . suffix ! , stringMatch . ignore_case ) ;
172
+ break ;
173
+ case 'contains' :
174
+ valueChecker = new ContainsValueMatcher ( stringMatch . contains ! , stringMatch . ignore_case ) ;
175
+ break ;
176
+ }
157
177
break ;
158
178
default :
159
179
valueChecker = new RejectValueMatcher ( ) ;
0 commit comments