get-request-origin
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -36,3 +36,3 @@ "use strict"; | ||
} = (0, _url.parse)(url); | ||
const isSecure = req.secure || req.connection?.encrypted; | ||
const isSecure = req.secure || (req.connection || {}).encrypted; | ||
const fallbackProtocol = isSecure ? 'https:' : 'http:'; | ||
@@ -39,0 +39,0 @@ const protocol = urlProtocol || fallbackProtocol; |
{ | ||
"name": "get-request-origin", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Get the URL origin from a Node request object.", | ||
@@ -5,0 +5,0 @@ "author": "Alex Mendes", |
@@ -22,3 +22,3 @@ import { parse as parseUrl } from 'url'; | ||
const isSecure = req.secure || req.connection?.encrypted; | ||
const isSecure = req.secure || (req.connection || {}).encrypted; | ||
const fallbackProtocol = isSecure ? 'https:' : 'http:'; | ||
@@ -25,0 +25,0 @@ const protocol = urlProtocol || fallbackProtocol; |
3428