2 const { IncomingMessage
} = require('http');
5 * Welp, here we are, already into the crazy.
6 * Per documentation (https://nodejs.org/docs/latest-v12.x/api/http.html#http_request_getheader_name)
7 * this should exist, yet (as of 12.18.4) it does not. So let us change this pitch up, and patch
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()];