feat: add unhandled error handlers + SSRF and Content-Disposition tests
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 13m5s
All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 13m5s
This commit is contained in:
parent
288d6c7aab
commit
c4fea7932c
2 changed files with 32 additions and 0 deletions
10
src/index.ts
10
src/index.ts
|
|
@ -422,6 +422,16 @@ async function start() {
|
|||
};
|
||||
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
||||
process.on("SIGINT", () => shutdown("SIGINT"));
|
||||
|
||||
process.on("uncaughtException", (err) => {
|
||||
logger.fatal({ err }, "Uncaught exception — shutting down");
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
process.on("unhandledRejection", (reason) => {
|
||||
logger.fatal({ err: reason }, "Unhandled rejection — shutting down");
|
||||
process.exit(1);
|
||||
});
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== "test") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue