Skip to content

Commit

Permalink
refactor(lib/request): use Object.hasOwn() (#304)
Browse files Browse the repository at this point in the history
Signed-off-by: Frazer Smith <frazer.dev@icloud.com>
  • Loading branch information
Fdawgs authored Oct 19, 2024
1 parent 151a05b commit 3481ba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function Request (options) {
}

// Set the content-length for the corresponding payload if none set
if (payload && !payloadResume && !Object.prototype.hasOwnProperty.call(this.headers, 'content-length')) {
if (payload && !payloadResume && !Object.hasOwn(this.headers, 'content-length')) {
this.headers['content-length'] = (Buffer.isBuffer(payload) ? payload.length : Buffer.byteLength(payload)).toString()
}

Expand Down

0 comments on commit 3481ba6

Please sign in to comment.