Skip to content

Commit a73ab9d

Browse files
committed
http: remove pointless use of arguments
PR-URL: #10664 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 022b53c commit a73ab9d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎lib/_http_outgoing.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,8 @@ OutgoingMessage.prototype.setHeader = function setHeader(name, value){
382382

383383

384384
OutgoingMessage.prototype.getHeader=functiongetHeader(name){
385-
if(arguments.length<1){
386-
thrownewError('"name" argument is required for getHeader(name)');
385+
if(typeofname!=='string'){
386+
thrownewTypeError('"name" argument must be a string');
387387
}
388388

389389
if(!this._headers)return;
@@ -393,8 +393,8 @@ OutgoingMessage.prototype.getHeader = function getHeader(name){
393393

394394

395395
OutgoingMessage.prototype.removeHeader=functionremoveHeader(name){
396-
if(arguments.length<1){
397-
thrownewError('"name" argument is required for removeHeader(name)');
396+
if(typeofname!=='string'){
397+
thrownewTypeError('"name" argument must be a string');
398398
}
399399

400400
if(this._header){

0 commit comments

Comments
(0)