Skip to content

Commit

Permalink
refactor(app): use sendNoContent for null handling
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Aug 8, 2023
1 parent 3f6d99e commit a72a4b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app.ts
Expand Up @@ -14,6 +14,7 @@ import {
MIMES,
sendWebResponse,
isWebResponse,
sendNoContent,
} from "./utils";
import type { EventHandler, LazyEventHandler } from "./types";

Expand Down Expand Up @@ -210,8 +211,7 @@ function normalizeLayer(input: InputLayer) {
function handleHandlerResponse(event: H3Event, val: any, jsonSpace?: number) {
// Empty Content
if (val === null) {
event.node.res.statusCode = 204;
return send(event);
return sendNoContent(event);
}

if (val) {
Expand Down

0 comments on commit a72a4b8

Please sign in to comment.