Skip to content

Commit e3c9f96

Browse files
committed
fix(router): use default behavior for no-content handling
1 parent a72a4b8 commit e3c9f96

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/router.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
import type { HTTPMethod, EventHandler } from "./types";
77
import { createError } from "./error";
88
import { eventHandler, toEventHandler } from "./event";
9-
import { setResponseStatus } from "./utils";
109

1110
export type RouterMethod = Lowercase<HTTPMethod>;
1211
const RouterMethods: RouterMethod[] = [
@@ -151,8 +150,7 @@ export function createRouter(opts: CreateRouterOptions = {}): Router {
151150
// Call handler
152151
return Promise.resolve(handler(event)).then((res) => {
153152
if (res === undefined && (opts.preemptive || opts.preemtive)) {
154-
setResponseStatus(event, 204);
155-
return "";
153+
return null; // Send empty content
156154
}
157155
return res;
158156
});

0 commit comments

Comments
 (0)