express-req-res-helper
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -32,3 +32,3 @@ "use strict"; | ||
const protocol = req.hostname.includes("localhost") ? "http" : "https"; | ||
const port = protocol === "http" ? process.env.PORT || "" : ""; | ||
const port = protocol === "http" && process.env.PORT ? `:${process.env.PORT}` : ""; | ||
return `${protocol}://${req.hostname}${port}${req.originalUrl}`; | ||
@@ -35,0 +35,0 @@ }; |
@@ -0,1 +1,2 @@ | ||
// @ts-ignore | ||
import { Request } from "express"; | ||
@@ -42,3 +43,4 @@ | ||
const protocol = req.hostname.includes("localhost") ? "http" : "https"; | ||
const port = protocol === "http" ? process.env.PORT || "" :""; | ||
// @ts-ignore | ||
const port = protocol === "http" && process.env.PORT ? `:${process.env.PORT}` :""; | ||
return `${protocol}://${req.hostname}${port}${req.originalUrl}`; | ||
@@ -45,0 +47,0 @@ }; |
{ | ||
"name": "express-req-res-helper", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"prepublish": "npm run build", | ||
@@ -5,0 +5,0 @@ "description": "this is a utility package to help extract a header from http request", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5693
143