Browse Source

http: remove pointless use of arguments

PR-URL: https://github.com/nodejs/node/pull/10664
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
v6
cjihrig 8 years ago
parent
commit
a73ab9de0d
  1. 8
      lib/_http_outgoing.js

8
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) {

Loading…
Cancel
Save