Socket
Socket
Sign inDemoInstall

ssl-express-www

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssl-express-www - npm Package Compare versions

Comparing version 1.3.0 to 2.0.0

14

lib/ForceSSL.js

@@ -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": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc