calamarble-xhub
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "calamarble-xhub", | ||
"description": "xhub signature verification for POST requests from facebook", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"main": "./src/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -19,3 +19,5 @@ 'use strict'; | ||
const apiEndpoint = config => (req, res) => { | ||
const serverSignature = signSha1(config.xHubSecret, JSON.stringify(req.body)); | ||
const rawBody = req.rawBody || JSON.stringify(req.body); | ||
const xHubSignature = req.headers['X-Hub-Signature']; | ||
const serverSignature = signSha1(config.xHubSecret, rawBody); | ||
const result = _extends({}, req.headers, { | ||
@@ -25,4 +27,6 @@ 'my-debug-header': serverSignature | ||
console.log('serverSignature:', serverSignature); | ||
console.log('X-Hub-Signature', xHubSignature); | ||
console.log('HEADERS', req.headers); | ||
console.log('RAW BODY', req.rawBody); | ||
console.log('RAW BODY TYPE', typeof req.rawBody); | ||
console.log('BODY', req.body); | ||
@@ -29,0 +33,0 @@ console.log('stringified BODY', JSON.stringify(req.body)); |
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
2995
39