From a73ab9de0dfd1d62c429263c68640388e88fe847 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 10 Jan 2017 11:58:08 -0500 Subject: [PATCH] http: remove pointless use of arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/10664 Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca --- lib/_http_outgoing.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 67a8d6f8bb8233..bf018d988d7abb 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -382,8 +382,8 @@ OutgoingMessage.prototype.setHeader = function setHeader(name, value) { OutgoingMessage.prototype.getHeader = function getHeader(name) { - if (arguments.length < 1) { - throw new Error('"name" argument is required for getHeader(name)'); + if (typeof name !== 'string') { + throw new TypeError('"name" argument must be a string'); } if (!this._headers) return; @@ -393,8 +393,8 @@ OutgoingMessage.prototype.getHeader = function getHeader(name) { OutgoingMessage.prototype.removeHeader = function removeHeader(name) { - if (arguments.length < 1) { - throw new Error('"name" argument is required for removeHeader(name)'); + if (typeof name !== 'string') { + throw new TypeError('"name" argument must be a string'); } if (this._header) {