Skip to content

Commit

Permalink
http: remove pointless use of arguments
Browse files Browse the repository at this point in the history
PR-URL: #10664
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
cjihrig committed Jan 10, 2017
1 parent 022b53c commit a73ab9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/_http_outgoing.js
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down

0 comments on commit a73ab9d

Please sign in to comment.