diff --git a/src/SlackHookHandler.ts b/src/SlackHookHandler.ts index ce20d81d..10fbd872 100644 --- a/src/SlackHookHandler.ts +++ b/src/SlackHookHandler.ts @@ -67,7 +67,7 @@ export class SlackHookHandler extends BaseSlackHandler { createServer = (cb) => httpsCreate(tlsOptions, cb); } return new Promise((resolve, reject) => { - const srv = createServer(this._onRequest.bind(this)); + const srv = createServer(this.onRequest.bind(this)); srv.once("error", reject); srv.listen(port, () => { const protocol = tlsConfig ? "https" : "http"; @@ -85,7 +85,7 @@ export class SlackHookHandler extends BaseSlackHandler { } } - public _onRequest(req: IncomingMessage, res: ServerResponse) { + private onRequest(req: IncomingMessage, res: ServerResponse) { const HTTP_SERVER_ERROR = 500; const {method, url } = req; if (!method || !url) { diff --git a/tests/integration/WebhookTest.ts b/tests/integration/WebhookTest.ts index 141d84ae..60c2602a 100644 --- a/tests/integration/WebhookTest.ts +++ b/tests/integration/WebhookTest.ts @@ -73,7 +73,7 @@ describe("WebhookTest", () => { }); }); - harness.hooks._onRequest(req, res); + harness.hooks['onRequest'](req, res); req.emit('end');