Skip to content

Commit

Permalink
fix(json-api-express): make sure response status is a number
Browse files Browse the repository at this point in the history
Regardless of Error instance has `status` property as string, convert it to number for `res.status()`.

Fixes #369
  • Loading branch information
nelson6e65 authored Nov 7, 2023
1 parent 1208c06 commit 9a6d535
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middlewares/json-api-express.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function jsonApiExpress(
try {
await authenticate(appInstance, req);
} catch (error) {
res.status(error.status).json(convertErrorToHttpResponse(error));
res.status(+error.status).json(convertErrorToHttpResponse(error));
return next();
}

Expand Down

0 comments on commit 9a6d535

Please sign in to comment.