mirror of https://github.com/grpc/grpc-node.git
Merge pull request #1834 from murgatroid99/grpc-js-xds_regex_match_case
grpc-js-xds: case_sensitive flag should not affect regex matcher
This commit is contained in:
commit
f5eb9ccbb4
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@grpc/grpc-js-xds",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"description": "Plugin for @grpc/grpc-js. Adds the xds:// URL scheme and associated features.",
|
||||
"main": "build/src/index.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -197,8 +197,8 @@ export class PathExactValueMatcher {
|
|||
|
||||
export class PathSafeRegexValueMatcher {
|
||||
private targetRegexImpl: RE2;
|
||||
constructor(targetRegex: string, caseInsensitive: boolean) {
|
||||
this.targetRegexImpl = new RE2(`^${targetRegex}$`, caseInsensitive ? 'iu' : 'u');
|
||||
constructor(targetRegex: string) {
|
||||
this.targetRegexImpl = new RE2(`^${targetRegex}$`, 'u');
|
||||
}
|
||||
|
||||
apply(value: string) {
|
||||
|
|
|
@ -169,7 +169,7 @@ function getPredicateForMatcher(routeMatch: RouteMatch__Output): Matcher {
|
|||
pathMatcher = new PathExactValueMatcher(routeMatch.path!, caseInsensitive);
|
||||
break;
|
||||
case 'safe_regex':
|
||||
pathMatcher = new PathSafeRegexValueMatcher(routeMatch.safe_regex!.regex, caseInsensitive);
|
||||
pathMatcher = new PathSafeRegexValueMatcher(routeMatch.safe_regex!.regex);
|
||||
break;
|
||||
default:
|
||||
pathMatcher = new RejectValueMatcher();
|
||||
|
|
Loading…
Reference in New Issue