Skip to content

Commit 3481ba6

Browse files
authored
refactor(lib/request): use Object.hasOwn() (#304)
Signed-off-by: Frazer Smith <[email protected]>
1 parent 151a05b commit 3481ba6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/request.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ function Request (options) {
170170
}
171171

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

0 commit comments

Comments
 (0)