Skip to content

Commit

Permalink
#fix: correct buffer send; add node 20 to the ci
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Oct 6, 2023
1 parent b2e906e commit 228e17d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node-clickhouse.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion lib/bun_wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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 })
Expand Down

0 comments on commit 228e17d

Please sign in to comment.