Skip to content

Commit

Permalink
fix: send method
Browse files Browse the repository at this point in the history
  • Loading branch information
grutt committed Nov 21, 2024
1 parent 5389916 commit 09b70c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hatchet-dev/typescript-sdk",
"version": "0.15.3",
"version": "0.15.4",
"description": "Background task orchestration & visibility for developers",
"types": "dist/index.d.ts",
"files": [
Expand Down
12 changes: 6 additions & 6 deletions src/clients/worker/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class WebhookHandler {
expressHandler({ secret }: HandlerOpts) {
return (req: any, res: any) => {
if (req.method === 'GET') {
res.sendStatus(200).send(okMessage);
res.status(200).send(okMessage);
return;
}

Expand All @@ -102,17 +102,17 @@ export class WebhookHandler {

this.getHealthcheckResponse(body, req.headers['x-hatchet-signature'], secret)
.then((resp) => {
res.sendStatus(200).json(resp);
res.status(200).json(resp);
})
.catch((err) => {
res.sendStatus(500);
res.status(500);
this.worker.logger.error(`Error handling request: ${err.message}`);
});
return;
}

if (req.method !== 'POST') {
res.sendStatus(405).json({ error: 'Method not allowed' });
res.status(405).json({ error: 'Method not allowed' });
return;
}

Expand All @@ -124,10 +124,10 @@ export class WebhookHandler {

this.handle(action, req.headers['x-hatchet-signature'], secret)
.then(() => {
res.sendStatus(200);
res.status(200);
})
.catch((err) => {
res.sendStatus(500);
res.status(500);
this.worker.logger.error(`Error handling request: ${err.message}`);
});
};
Expand Down

0 comments on commit 09b70c5

Please sign in to comment.