X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpatches%2Fincoming-message.js;h=237d95e4ed8927bd3f3c46e98ed09ebb65e80f00;hb=HEAD;hp=0b2e259c499ec932708c783dfbd44391b9e93564;hpb=aee1a77b22217893a609e581de7e4d3521e2c54e;p=squeep-api-dingus diff --git a/lib/patches/incoming-message.js b/lib/patches/incoming-message.js index 0b2e259..1669331 100644 --- a/lib/patches/incoming-message.js +++ b/lib/patches/incoming-message.js @@ -1,5 +1,5 @@ 'use strict'; -const { IncomingMessage } = require('http'); +const { IncomingMessage } = require('node:http'); /** * Welp, here we are, already into the crazy. @@ -12,6 +12,6 @@ if (typeof IncomingMessage.getHeader !== 'function') { if (typeof name !== 'string') { throw new TypeError('\'name\' must be a string'); } - return this.headers && this.headers[name.toLowerCase()]; + return this.headers?.[name.toLowerCase()]; }; }