Socket
Socket
Sign inDemoInstall

express-https

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

2

package.json

@@ -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();
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc