mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-10-19 22:27:20 +02:00
fix: let compressed proxy errors finish flushing
This commit is contained in:
1 parent
f32b2c6eb7
commit
6c0d335e98
2 files changed
+27
-4
No files matched your search
@@ -116,6 +116,7 @@ router.get(
|
||||
: undefined,
|
||||
err: serializeError(err),
|
||||
});
|
||||
const streaming = res.headersSent;
|
||||
handleError(
|
||||
new AnonymousError(errCode, {
|
||||
url: req.originalUrl,
|
||||
@@ -127,7 +128,7 @@ router.get(
|
||||
// Once ZIP bytes have been sent, handleError cannot send JSON.
|
||||
// Terminate the truncated response so the client reports failure
|
||||
// instead of waiting forever for the ZIP's central directory.
|
||||
if (res.headersSent && !res.writableEnded) res.destroy();
|
||||
if (streaming && !res.writableEnded) res.destroy();
|
||||
});
|
||||
reqStream.pipe(res);
|
||||
res.on("close", () => {
|
||||
|
||||
Reference in new issue
Block a user