feat(xo-server/_handleHttpRequest): send directly string/Buffer results
This commit is contained in:
@@ -145,7 +145,9 @@ export default class Xo extends EventEmitter {
|
||||
}).then(
|
||||
result => {
|
||||
if (result != null) {
|
||||
if (typeof result.pipe === 'function') {
|
||||
if (typeof result === 'string' || Buffer.isBuffer(result)) {
|
||||
res.end(result)
|
||||
} else if (typeof result.pipe === 'function') {
|
||||
result.pipe(res)
|
||||
} else {
|
||||
res.end(JSON.stringify(result))
|
||||
|
||||
Reference in New Issue
Block a user