Skip to content

Commit 838f77d

Browse files
committed
simplified the regex
1 parent 42c05f4 commit 838f77d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/event-handler/src/rest/RouteHandlerRegistry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class RouteHandlerRegistry {
104104

105105
const compiled = compilePath(route.path);
106106

107-
if (/[^a-zA-Z0-9/-:]/.test(compiled.path)) {
107+
if (/[\w/:-]/.test(compiled.path)) {
108108
if (this.#regexRoutes.has(route.id)) {
109109
this.#logger.warn(
110110
`Handler for method: ${route.method} and path: ${route.path} already exists. The previous handler will be replaced.`

0 commit comments

Comments
 (0)