ssl-express-www
Advanced tools
Comparing version 1.3.0 to 2.0.0
@@ -16,13 +16,17 @@ 'use strict'; | ||
if (www.indexOf('localhost') < 0 && schema !== 'https') { | ||
var notLocalHost = function notLocalHost() { | ||
return www.indexOf('localhost') < 0; | ||
}; | ||
if (notLocalHost() && schema !== 'https') { | ||
res.redirect(removeSlash(fullUrl)); | ||
} else if (/^www\./i.test(req.headers.host) && schema === 'https') { | ||
} else if (notLocalHost() && /^www\./i.test(req.headers.host) && schema === 'https') { | ||
res.redirect(removeSlash(fullUrl)); | ||
} else if (/\/$/.test(fullUrl) && fullUrl !== 'https://' + www + '/') { | ||
} else if (notLocalHost() && /\/$/.test(fullUrl) && fullUrl !== 'https://' + www + '/') { | ||
res.redirect(removeSlash(fullUrl)); | ||
} else { | ||
next(); | ||
} | ||
return next(); | ||
}; | ||
module.exports = exports['default']; |
{ | ||
"name": "ssl-express-www", | ||
"version": "1.3.0", | ||
"version": "2.0.0", | ||
"description": "Force SSL (HTTPS) when HTTP is required using Express (Nodejs). Remove www and slash end on domain.", | ||
@@ -11,3 +11,3 @@ "main": "index.js", | ||
"test": "./node_modules/.bin/mocha specs/**/*.spec.js --require babel-register", | ||
"prepare": "npm run build" | ||
"test-watch": "npm run test -- --watch || ECHO." | ||
}, | ||
@@ -14,0 +14,0 @@ "keywords": [ |
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
5912
5
25