diff --git a/src/router.ts b/src/router.ts index 0d4b3a6f..3f6e8b18 100644 --- a/src/router.ts +++ b/src/router.ts @@ -6,7 +6,6 @@ import { import type { HTTPMethod, EventHandler } from "./types"; import { createError } from "./error"; import { eventHandler, toEventHandler } from "./event"; -import { setResponseStatus } from "./utils"; export type RouterMethod = Lowercase; const RouterMethods: RouterMethod[] = [ @@ -151,8 +150,7 @@ export function createRouter(opts: CreateRouterOptions = {}): Router { // Call handler return Promise.resolve(handler(event)).then((res) => { if (res === undefined && (opts.preemptive || opts.preemtive)) { - setResponseStatus(event, 204); - return ""; + return null; // Send empty content } return res; });