Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx authored May 2, 2024
1 parent 4374462 commit dceabbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const {
isValidHeaderValue,
isStream,
destroy,
isBuffer,
isFormDataLike,
isIterable,
isBlobLike,
Expand Down Expand Up @@ -111,7 +112,7 @@ class Request {
}
}
this.body.on('error', this.errorHandler)
} else if (Buffer.isBuffer(body)) {
} else if (isBuffer(body)) {
this.body = body.byteLength ? body : null
} else if (ArrayBuffer.isView(body)) {
this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null
Expand Down

0 comments on commit dceabbc

Please sign in to comment.