소스 검색

refactor regexp

yuken 4 년 전
부모
커밋
9733ef3067
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      packages/app/src/server/middlewares/api-rate-limiter.ts

+ 1 - 1
packages/app/src/server/middlewares/api-rate-limiter.ts

@@ -28,7 +28,7 @@ const rateLimiter = new RateLimiterMongo(opts);
 // generate ApiRateLimitConfig for api rate limiter
 const apiRateLimitConfigWithoutRegExp = generateApiRateLimitConfig(false);
 const apiRateLimitConfigWithRegExp = generateApiRateLimitConfig(true);
-const allRegExp = new RegExp(Object.keys(apiRateLimitConfigWithRegExp).join(' | '));
+const allRegExp = new RegExp(Object.keys(apiRateLimitConfigWithRegExp).join('|'));
 const keysWithRegExp = Object.keys(apiRateLimitConfigWithRegExp).map(key => new RegExp(key));
 const valuesWithRegExp = Object.values(apiRateLimitConfigWithRegExp);