Skip to content

Commit

Permalink
fix: allowedMethods() should not fail if more than one router is defi…
Browse files Browse the repository at this point in the history
…ned (#183)

Fixes #182
  • Loading branch information
lbesson-della committed Sep 12, 2024
1 parent e19c62b commit 76020dd
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 76020dd

Please sign in to comment.