Skip to content

Commit

Permalink
fix: return 'false' and 'null' values as JSON strings (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 9, 2021
1 parent 2576b2a commit 5613c54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ export function createHandle (stack: Stack): PHandle {
if (type === 'string') {
return send(res, val, MIMES.html)
} else if (type === 'object' && val !== undefined) {
if (val.buffer) {
// Return 'false' and 'null' values as JSON strings
if (val && val.buffer) {
return send(res, val)
} else if (val instanceof Error) {
throw createError(val)
Expand Down

0 comments on commit 5613c54

Please sign in to comment.