Skip to content

Commit

Permalink
fix: scan route files with other chars in param name
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Nov 11, 2024
1 parent 49c1560 commit 21f0c08
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/scan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export async function scanServerRoutes(
.replace(/\(([^(/\\]+)\)[/\\]/g, "")
.replace(/\[\.{3}]/g, "**")
.replace(/\[\.{3}(\w+)]/g, "**:$1")
.replace(/\[(\w+)]/g, ":$1");
.replace(/\[([^/\]]+)]/g, ":$1");
route = withLeadingSlash(withoutTrailingSlash(withBase(route, prefix)));

const suffixMatch = route.match(suffixRegex);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default eventHandler((event) => {
setHeader(event, "Content-Type", "text/plain; charset=utf-16");
return event.context.params!.id;
return event.context.params!["test-id"];
});

0 comments on commit 21f0c08

Please sign in to comment.