express-public-url
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -12,5 +12,6 @@ 'use strict'; | ||
var hostHeaderValue = String(req.headers.host || ''); | ||
var protocol = (req.headers['x-forwarded-proto'] || '').split(',')[0] || req.protocol || 'http'; | ||
var host = (req.headers['x-forwarded-host'] || '').split(',')[0] || req.headers.host.replace(/:[0-9]+/, ''); | ||
var port = (req.headers['x-forwarded-port'] || '').split(',')[0] || req.app.settings.port || (req.headers.host.match(/:([0-9]+)/) || [])[1] || ''; | ||
var host = (req.headers['x-forwarded-host'] || '').split(',')[0] || hostHeaderValue.replace(/:[0-9]+/, ''); | ||
var port = (req.headers['x-forwarded-port'] || '').split(',')[0] || req.app.settings.port || (hostHeaderValue.match(/:([0-9]+)/) || [])[1] || ''; | ||
var resource = (req.url === '/') ? '' : req.url; | ||
@@ -17,0 +18,0 @@ |
{ | ||
"name": "express-public-url", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Makes it easy to access correct URL when running behind a proxy or load balancer", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
4127
34