@podium/utils
Advanced tools
Comparing version 4.2.0 to 4.2.1
'use strict'; | ||
const originalUrl = require('original-url'); | ||
const { URL } = require('url'); | ||
@@ -18,5 +19,7 @@ | ||
const protocolFromRequest = (request = {}) => { | ||
const secure = | ||
request.secure || (request.connection && request.connection.encrypted); | ||
return secure ? 'https:' : 'http:'; | ||
if (request.headers) { | ||
const url = originalUrl(request); | ||
return url.protocol ? url.protocol : 'http:'; | ||
} | ||
return 'http:'; | ||
}; | ||
@@ -23,0 +26,0 @@ |
{ | ||
"name": "@podium/utils", | ||
"version": "4.2.0", | ||
"version": "4.2.1", | ||
"description": "Common generic utility methods shared by @podium modules.", | ||
@@ -60,4 +60,5 @@ "license": "MIT", | ||
"@podium/schemas": "4.0.1", | ||
"original-url": "1.2.3", | ||
"camelcase": "5.3.1" | ||
} | ||
} |
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
35311
785
3
+ Addedoriginal-url@1.2.3
+ Addedforwarded-parse@2.1.2(transitive)
+ Addedoriginal-url@1.2.3(transitive)