Merge branch 'v2.1-dev' as v2.1.2
[squeep-api-dingus] / lib / patches / incoming-message.js
index 0b2e259c499ec932708c783dfbd44391b9e93564..1669331f7f7764a369cb6a2127b66404c145be31 100644 (file)
@@ -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()];
   };
 }