sns-validator
Advanced tools
Comparing version 0.3.3 to 0.3.4
12
index.js
@@ -192,3 +192,11 @@ "use strict"; | ||
MessageValidator.prototype.validate = function (hash, cb) { | ||
var hostPattern = this.hostPattern; | ||
if (typeof hash === 'string') { | ||
try { | ||
hash = JSON.parse(hash); | ||
} catch (err) { | ||
cb(err); | ||
return; | ||
} | ||
} | ||
hash = convertLambdaMessage(hash); | ||
@@ -201,3 +209,3 @@ | ||
if (!validateUrl(hash['SigningCertURL'], hostPattern)) { | ||
if (!validateUrl(hash['SigningCertURL'], this.hostPattern)) { | ||
cb(new Error('The certificate is located on an invalid domain.')); | ||
@@ -204,0 +212,0 @@ return; |
{ | ||
"name": "sns-validator", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "A standalone validator for inbound SNS HTTP messages. No dependency on the AWS SDK for JavaScript.", | ||
@@ -10,5 +10,2 @@ "repository": { | ||
"main": "index.js", | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"devDependencies": { | ||
@@ -23,3 +20,3 @@ "chai": "^3.3.0", | ||
"scripts": { | ||
"test": "node_modules/mocha/bin/mocha" | ||
"test": "mocha" | ||
}, | ||
@@ -26,0 +23,0 @@ "keywords": [ |
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
23020
187