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 Apr 29, 2024
1 parent f1d784d commit e60e114
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 @@ -77,7 +77,7 @@ ${handlers
h.handler,
h.lazy
)}, lazy: ${!!h.lazy}, middleware: ${!!h.middleware}, method: ${JSON.stringify(
h.method
h.method?.toLowerCase()
)} }`
)
.join(",\n")}
Expand All @@ -98,7 +98,7 @@ export const handlersMeta = [
.map(
(h) =>
/* js */ `{ route: ${JSON.stringify(h.route)}, method: ${JSON.stringify(
h.method
h.method?.toLowerCase()
)}, meta: ${getImportId(h.handler)}Meta }`
)
.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 e60e114

Please sign in to comment.