Set and clear timeout for external requests

otherwise, the server crashes for a write after timeout
This commit is contained in:
Girish Ramakrishnan
2020-12-06 23:31:54 -08:00
parent 78752fde7a
commit 3b8bc47ee5
2 changed files with 3 additions and 2 deletions

View File

@@ -43,6 +43,7 @@ function proxy(req, res, next) {
proxyOptions.rejectUnauthorized = false;
const mailserverProxy = middleware.proxy(proxyOptions);
req.clearTimeout(); // TODO: add timeout to mail server proxy logic instead of this
mailserverProxy(req, res, function (error) {
if (!error) return next();