Skip to content

Commit

Permalink
fix: allowedMethods() should not fail if more than one router is defined
Browse files Browse the repository at this point in the history
Fixes #182
  • Loading branch information
lbesson-della committed Sep 11, 2024
1 parent 9b7339d commit 6352221
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class Router {
ctx.routerPath;
const matched = router.match(path, ctx.method);
if (ctx.matched) {
ctx.matched.push(matched.path);
ctx.matched.push.apply(ctx.matched, matched.path);

Check warning on line 231 in lib/router.js

View workflow job for this annotation

GitHub Actions / Node 18 on ubuntu-latest

Use the spread operator instead of '.apply()'.

Check warning on line 231 in lib/router.js

View workflow job for this annotation

GitHub Actions / Node 20 on ubuntu-latest

Use the spread operator instead of '.apply()'.

Check warning on line 231 in lib/router.js

View workflow job for this annotation

GitHub Actions / Node 22 on ubuntu-latest

Use the spread operator instead of '.apply()'.
} else {
ctx.matched = matched.path;
}
Expand Down

0 comments on commit 6352221

Please sign in to comment.