Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
http: remove pointless use of arguments
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
commit a73ab9de0dfd1d62c429263c68640388e88fe847
8 changes: 4 additions & 4 deletions lib/_http_outgoing.js
Original file line number Diff line number Diff line change
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