feat: Added check to support Uint8Array in response sending (#6285)

Unified usage of ArrayBuffer.isView to comprehend Buffer and removed isView function check

Co-authored-by: Wes Todd <wes@wesleytodd.com>

Added Uint8Array test with encoding

fix: added history.md entry
This commit is contained in:
Alexander Cerutti
2025-01-18 21:37:48 +01:00
committed by Wes Todd
parent af7cd90893
commit 55869f49a6
3 changed files with 15 additions and 1 deletions

View File

@@ -130,7 +130,7 @@ res.send = function send(body) {
case 'object':
if (chunk === null) {
chunk = '';
} else if (Buffer.isBuffer(chunk)) {
} else if (ArrayBuffer.isView(chunk)) {
if (!this.get('Content-Type')) {
this.type('bin');
}