@podium/utils
Advanced tools
Comparing version 4.2.1 to 4.2.2
@@ -18,13 +18,6 @@ 'use strict'; | ||
const protocolFromRequest = (request = {}) => { | ||
if (request.headers) { | ||
const urlFromRequest = (request) => { | ||
try { | ||
const url = originalUrl(request); | ||
return url.protocol ? url.protocol : 'http:'; | ||
} | ||
return 'http:'; | ||
}; | ||
const urlFromRequest = (request, protocol) => { | ||
try { | ||
return new URL(request.url, `${protocol}//${request.headers.host}`); | ||
return new URL(url.pathname, `${url.protocol}//${request.headers.host}`); | ||
} catch (err) { | ||
@@ -37,4 +30,3 @@ return {}; | ||
constructor(request = {}, response = {}, params = {}) { | ||
const protocol = protocolFromRequest(request); | ||
const url = urlFromRequest(request, protocol); | ||
const url = urlFromRequest(request); | ||
@@ -41,0 +33,0 @@ // Private properties |
{ | ||
"name": "@podium/utils", | ||
"version": "4.2.1", | ||
"version": "4.2.2", | ||
"description": "Common generic utility methods shared by @podium modules.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
35082
778