ensure-https-www
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -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 @@ }, |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12680
2
211
0
- Removedleft-pad@^1.1.1
- Removedleft-pad@1.3.0(transitive)