Skip to content

Commit 5613c54

Browse files
authored
fix: return 'false' and 'null' values as JSON strings (#33)
1 parent 2576b2a commit 5613c54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/app.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ export function createHandle (stack: Stack): PHandle {
114114
if (type === 'string') {
115115
return send(res, val, MIMES.html)
116116
} else if (type === 'object' && val !== undefined) {
117-
if (val.buffer) {
117+
// Return 'false' and 'null' values as JSON strings
118+
if (val && val.buffer) {
118119
return send(res, val)
119120
} else if (val instanceof Error) {
120121
throw createError(val)

0 commit comments

Comments
 (0)