filemanager: do not respond again

This commit is contained in:
Girish Ramakrishnan
2024-08-08 15:20:50 +02:00
parent 21705a0e96
commit 2ff995aa95
+3 -2
View File
@@ -41,8 +41,9 @@ function proxy(kind) {
const sftpReq = http.request(opts, function (sftpRes) {
res.writeHead(sftpRes.statusCode, sftpRes.headers);
sftpRes.on('error', (error) => next(new HttpError(500, `filemanager error: ${error.message} ${error.code}`)));
sftpRes.on('end', () => next());
// note: these are intentionally not handled. response has already been written. do not forward to connect-lastmile
// sftpRes.on('error', (error) => next(new HttpError(500, `filemanager error: ${error.message} ${error.code}`)));
// sftpRes.on('end', () => next());
sftpRes.pipe(res);
});
sftpReq.on('error', (error) => next(new HttpError(424, `Unable to connect to filemanager: ${error.message} ${error.code}`)));