Skip to content
Myr

Fixed SlowBuffer support. Closes #584

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent cdbd8af · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:lib/response.js+2 added-2 removed
66 unmodified lines
67 this.contentType('.html');68 }69 break;70 case 'object':71 if (body instanceof Buffer) {71 if (Buffer.isBuffer(body)) {72 if (!this.header('Content-Type')) {73 this.contentType('.bin');74 }75 } else {
10 unmodified lines
86 }8788 // populate Content-Length89 if (!this.header('Content-Length')) {90 this.header('Content-Length', body instanceof Buffer90 this.header('Content-Length', Buffer.isBuffer(Buffer)91 ? body.length92 : Buffer.byteLength(body));93 }94
291 unmodified lines