Skip to content

Commit b5d077f

Browse files
nicky1038smorimoto
authored andcommitted
allow leading symbols _[\]^` in query param regex because they were allowed earlier
1 parent 7edabde commit b5d077f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/schema-routes/schema-routes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,9 @@ export class SchemaRoutes {
9595
this.config.hooks.onPreBuildRoutePath(originalRouteName) ||
9696
originalRouteName;
9797

98+
// TODO forbid leading symbols [\]^` in a major release (allowed yet for backwards compatibility)
9899
const pathParamMatches = (routeName || "").match(
99-
/({[a-zA-Z]([-_.]*[a-zA-Z0-9])*})|(:[a-zA-Z]([-_.]*[a-zA-Z0-9])*:?)/g,
100+
/({[a-zA-Z_[\\\]^`]([-_.]*[a-zA-Z0-9])*})|(:[a-zA-Z_[\\\]^`]([-_.]*[a-zA-Z0-9])*:?)/g,
100101
);
101102

102103
// used in case when path parameters is not declared in requestInfo.parameters ("in": "path")

0 commit comments

Comments
 (0)