Skip to content

Commit

Permalink
Added check to support Uint8Array in response sending
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandercerutti committed Jan 18, 2025
1 parent ff86319 commit c4cf614
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ res.send = function send(body) {
case 'object':
if (chunk === null) {
chunk = '';
} else if (Buffer.isBuffer(chunk)) {
} else if (Buffer.isBuffer(chunk) || (typeof ArrayBuffer.isView === "function" && ArrayBuffer.isView(chunk))) {
if (!this.get('Content-Type')) {
this.type('bin');
}
Expand Down

0 comments on commit c4cf614

Please sign in to comment.