2 const { IncomingMessage
} = require('http');
5 * Welp, here we are, already into the crazy.
6 * This originally existed due to a misinterpretation of the documentation,
7 * but it's really quite useful, so it stays in our world.
9 /* istanbul ignore else */
10 if (typeof IncomingMessage
.getHeader
!== 'function') {
11 IncomingMessage
.prototype.getHeader = function (name
) {
12 if (typeof name
!== 'string') {
13 throw new TypeError('\'name\' must be a string');
15 return this.headers
&& this.headers
[name
.toLowerCase()];