express-https
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -12,3 +12,3 @@ { | ||
"main": "./redirect.js", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"repository": { | ||
@@ -15,0 +15,0 @@ "type": "git", |
@@ -1,9 +0,16 @@ | ||
module.exports = function express_https(options) | ||
module.exports.ensureSSL = function (req, res, next) | ||
{ | ||
options = options || {}; | ||
var options = options || {}; | ||
return function ensureSSL(req, res, next) | ||
function redirect() | ||
{ | ||
console.log('---------------------' + req.protocol); | ||
console.log('redirect to SSL for ' + req.host + req.url); | ||
if (req.protocol === 'http') | ||
res.redirect('https://' + req.host + req.url); | ||
else | ||
next(); | ||
} | ||
} | ||
redirect(); | ||
} |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
830
13
0