mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 20:20:49 +00:00
Proxyres on close and end
This commit is contained in:
parent
a2d05b0cf0
commit
ee82134c19
1 changed files with 16 additions and 0 deletions
|
|
@ -30,6 +30,22 @@ export function handleHttpProxyRequest(req, res) {
|
|||
// Stream error while piping response
|
||||
// Response headers already sent, can't send error status
|
||||
});
|
||||
|
||||
proxyRes.on("close", () => {
|
||||
console.log("Proxy response stream closed");
|
||||
// Clean up if the proxy response stream closes
|
||||
if (!res.writableEnded) {
|
||||
res.end();
|
||||
}
|
||||
});
|
||||
|
||||
proxyRes.on("end", () => {
|
||||
console.log("Proxy response stream ended");
|
||||
// End of proxy response
|
||||
if (!res.writableEnded) {
|
||||
res.end();
|
||||
}
|
||||
});
|
||||
}
|
||||
)
|
||||
.on("error", (err) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue