Skip to content

Commit

Permalink
fix: allow returning, number and boolean as well (#65)
Browse files Browse the repository at this point in the history
Co-authored-by: pooya parsa <pyapar@gmail.com>
  • Loading branch information
danielroe and pi0 committed Mar 11, 2022
1 parent 57f5c9c commit 9a01465
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9a01465

Please sign in to comment.