Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ensure-https-www

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ensure-https-www - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

14

lib/index.js

@@ -21,8 +21,10 @@ #!/usr/bin/env node

var promises = tests.map(function (test) {
return request.get(test.url).then(function (res) {
test.result = Result(test, res);
return test;
}).catch(function (err) {
test.result = Result(test, err.response);
return test;
return new Promise(function (resolve) {
request.get(test.url).end(function (err, res) {
var response;
if (err && !err.response) response = { error: err.message };else if (err) response = err.response;else response = res;
test.result = Result(test, response);
resolve(test);
});
});

@@ -29,0 +31,0 @@ });

@@ -11,2 +11,12 @@ 'use strict';

// FAIL
// no response
if (res.error) {
result.message = res.error;
result.pass = false;
result.response = undefined;
result.status = 'FAIL';
return result;
}
var redirects = res.redirects;

@@ -85,3 +95,3 @@ var redirectsExpected = test.to.length > 0;

if (result.status === '') throw new Error('This should never happen!');
if (result.status === String) throw new Error('This should never happen!');
result.pass = result.status === 'PASS';

@@ -88,0 +98,0 @@

{
"name": "ensure-https-www",
"version": "2.0.0",
"version": "2.1.0",
"description": "Ensure your domain redirects non-https non-www requests appropriately.",

@@ -32,3 +32,2 @@ "author": "Scott Hardy",

"chalk": "^1.1.3",
"left-pad": "^1.1.1",
"superagent": "^2.0.0"

@@ -35,0 +34,0 @@ },

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