Skip to content

Commit ddd8dcc

Browse files
committed
adapt for #514
1 parent 8d3a7dd commit ddd8dcc

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/middleware/node/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { Webhooks } from "../../index";
2-
import { EmitterWebhookEvent } from "../../types";
32
import { middleware } from "./middleware";
43
import { onUnhandledRequestDefault } from "./on-unhandled-request-default";
54
import { MiddlewareOptions } from "./types";
65

76
export function createNodeMiddleware(
8-
webhooks: Webhooks<EmitterWebhookEvent>,
7+
webhooks: Webhooks,
98
{
109
path = "/api/github/webhooks",
1110
onUnhandledRequest = onUnhandledRequestDefault,

src/middleware/node/middleware.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import { IncomingMessage, ServerResponse } from "http";
33
import { WebhookEventName } from "@octokit/webhooks-definitions/schema";
44

55
import { Webhooks } from "../../index";
6-
import { EmitterWebhookEvent, WebhookEventHandlerError } from "../../types";
6+
import { WebhookEventHandlerError } from "../../types";
77
import { MiddlewareOptions } from "./types";
88
import { onUnhandledRequestDefault } from "./on-unhandled-request-default";
99
import { getMissingHeaders } from "./get-missing-headers";
1010
import { getPayload } from "./get-payload";
1111

1212
export function middleware(
13-
webhooks: Webhooks<EmitterWebhookEvent>,
13+
webhooks: Webhooks,
1414
options: Required<MiddlewareOptions>,
1515
request: IncomingMessage,
1616
response: ServerResponse,
@@ -76,9 +76,6 @@ export function middleware(
7676
.catch((error: WebhookEventHandlerError) => {
7777
clearTimeout(timeout);
7878

79-
console.log(`error`);
80-
console.log(error);
81-
8279
if (didTimeout) return;
8380

8481
const statusCode = Array.from(error)[0].status;

src/verify/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function verify(
1919

2020
const signatureBuffer = Buffer.from(signature);
2121
const algorithm = getAlgorithm(signature);
22+
2223
const verificationBuffer = Buffer.from(
2324
sign({ secret, algorithm }, eventPayload)
2425
);

0 commit comments

Comments
 (0)