From 9a0146577b6fe9399bfafd7ec531b8be5bb82909 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 11 Mar 2022 14:17:31 +0000 Subject: [PATCH] fix: allow returning, number and boolean as well (#65) Co-authored-by: pooya parsa --- src/app.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app.ts b/src/app.ts index d823f756..86c93274 100644 --- a/src/app.ts +++ b/src/app.ts @@ -114,8 +114,7 @@ export function createHandle (stack: Stack, options: AppOptions): PHandle { const type = typeof val if (type === 'string') { return send(res, val, MIMES.html) - } else if (type === 'object' && val !== undefined) { - // Return 'false' and 'null' values as JSON strings + } else if (type === 'object' || type === 'boolean' || type === 'number' /* IS_JSON */) { if (val && val.buffer) { return send(res, val) } else if (val instanceof Error) {