mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-13 14:18:57 +02:00
fix: close streaming responses after upstream errors
This commit is contained in:
@@ -39,6 +39,7 @@ router.post(
|
||||
);
|
||||
} catch (error) {
|
||||
handleError(error, res);
|
||||
if (res.headersSent && !res.writableEnded) res.destroy();
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -111,6 +112,8 @@ router.post("/", async (req: express.Request, res: express.Response) => {
|
||||
content.destroy();
|
||||
}
|
||||
handleError(error, res);
|
||||
if (res.headersSent && !res.writableEnded) res.destroy();
|
||||
anonymizer.destroy();
|
||||
}
|
||||
content
|
||||
.on("error", handleStreamError)
|
||||
|
||||
Reference in New Issue
Block a user