Check name directly instead of arguments length
This commit is contained in:
parent
a2588c1fd9
commit
fcb7cbc54a
2 changed files with 22 additions and 2 deletions
|
@ -259,7 +259,7 @@ class ClientRequest extends EventEmitter {
|
|||
}
|
||||
|
||||
getHeader (name) {
|
||||
if (arguments.length < 1) {
|
||||
if (name == null) {
|
||||
throw new Error('`name` is required for getHeader(name).')
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ class ClientRequest extends EventEmitter {
|
|||
}
|
||||
|
||||
removeHeader (name) {
|
||||
if (arguments.length < 1) {
|
||||
if (name == null) {
|
||||
throw new Error('`name` is required for removeHeader(name).')
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue