Skip to content

Commit

Permalink
fix(serveStatic): set allow header when responding with a 405 (#868)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaharu authored Oct 3, 2024
1 parent d9a43dd commit 7324eee
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export async function serveStatic(
): Promise<false | undefined | null | BodyInit> {
if (event.request.method !== "GET" && event.request.method !== "HEAD") {
if (!options.fallthrough) {
event.response.headers.set("allow", "GET, HEAD");
throw createError({
statusMessage: "Method Not Allowed",
statusCode: 405,
Expand Down

0 comments on commit 7324eee

Please sign in to comment.