@octokit/webhooks
Advanced tools
Comparing version 4.0.0 to 5.0.0
@@ -27,7 +27,9 @@ module.exports = middleware | ||
if (missingHeaders) { | ||
debug(`ignored: ${request.method} ${request.url} due to missing headers: ${missingHeaders}`) | ||
const error = new Error(`Required headers missing: ${missingHeaders}`) | ||
response.statusCode = 400 | ||
response.end(`Required headers missing: ${missingHeaders}`) | ||
return | ||
return state.eventHandler.receive(error) | ||
.catch(() => { | ||
response.statusCode = 400 | ||
response.end(error.message) | ||
}) | ||
} | ||
@@ -34,0 +36,0 @@ |
{ | ||
"name": "@octokit/webhooks", | ||
"version": "4.0.0", | ||
"version": "5.0.0", | ||
"publishConfig": { | ||
@@ -20,3 +20,3 @@ "access": "public" | ||
"coveralls": "^3.0.0", | ||
"get-port": "^3.2.0", | ||
"get-port": "^4.0.0", | ||
"pify": "^3.0.0", | ||
@@ -27,3 +27,3 @@ "proxyquire": "^2.0.0", | ||
"standard": "^11.0.0", | ||
"tap": "^11.0.0" | ||
"tap": "^12.0.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "scripts": { |
@@ -101,3 +101,3 @@ # @octokit/webhooks | ||
```js | ||
weebhooks.sign(eventPayload) | ||
webhooks.sign(eventPayload) | ||
``` | ||
@@ -129,3 +129,3 @@ | ||
```js | ||
weebhooks.verify(eventPayload, signature) | ||
webhooks.verify(eventPayload, signature) | ||
``` | ||
@@ -171,3 +171,3 @@ | ||
```js | ||
weebhooks.verifyAndReceive({id, name, payload, signature}) | ||
webhooks.verifyAndReceive({id, name, payload, signature}) | ||
``` | ||
@@ -174,0 +174,0 @@ |
@@ -96,2 +96,4 @@ const http = require('http') | ||
const server = http.createServer(api.middleware) | ||
const errorHandler = simple.spy() | ||
api.on('error', errorHandler) | ||
@@ -118,2 +120,3 @@ promisify(server.listen.bind(server))(this.port) | ||
.then(() => { | ||
t.is(errorHandler.callCount, 1, 'calls "error" event handler') | ||
server.close(t.end) | ||
@@ -120,0 +123,0 @@ }) |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
65969
1136
2