#fix: correct buffer send; add node 20 to the ci

This commit is contained in:
akvlad
2023-10-06 15:24:05 +03:00
parent b2e906e67a
commit 228e17d684
2 changed files with 3 additions and 2 deletions

View File

@ -23,7 +23,7 @@ jobs:
strategy:
matrix:
node-version: [18, 16.x]
node-version: [18, 16.x, 20]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:

View File

@ -26,6 +26,7 @@ const wrapper = (handler, parsers) => {
let status = 200
let reqBody = ''
let headers = {}
log.info(`${ctx.url}`)
const stream = new BodyStream()
setTimeout(async () => {
@ -115,7 +116,7 @@ const wrapper = (handler, parsers) => {
if (result) {
response = result
}
if (response instanceof Object && typeof response !== 'string') {
if (response instanceof Object && typeof response !== 'string' && !Buffer.isBuffer(response)) {
response = JSON.stringify(response)
}
return new Response(response, { status: status, headers: headers })