Skip to content

Commit

Permalink
fix: lower-case accepted handler method (#2382)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsonleex authored and pi0 committed Jun 27, 2024
1 parent 50504ab commit 206ef3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rollup/plugins/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function handlers(nitro: Nitro) {
.map((h) => {
return {
route: h.route,
method: h.method,
method: h.method?.toLowerCase(),
};
});

Expand All @@ -70,7 +70,7 @@ ${handlers
h.handler,
h.lazy
)}, lazy: ${!!h.lazy}, middleware: ${!!h.middleware}, method: ${JSON.stringify(
h.method
h.method?.toLowerCase()
)} }`
)
.join(",\n")}
Expand Down
2 changes: 2 additions & 0 deletions test/fixture/nitro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export default defineNitroConfig({
{
route: "/api/test/*/foo",
handler: "~/api/hello.ts",
// @ts-expect-error #2382
method: "GET",
},
],
devProxy: {
Expand Down

0 comments on commit 206ef3f

Please sign in to comment.