From d257b9be96250b71ac02ffcf2116650d568c7b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Fri, 14 Apr 2023 10:58:52 +0200 Subject: [PATCH] Fix HEAD not being retried for HTTP 500 category responses. See #579 --- lib/upload.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/upload.js b/lib/upload.js index 83dfa35b..c3857850 100644 --- a/lib/upload.js +++ b/lib/upload.js @@ -615,6 +615,11 @@ class BaseUpload { if (status === 423) { this._emitHttpError(req, res, 'tus: upload is currently locked; retry later') return + } else if (inStatusCategory(status, 500)) { + // Run retry logic if the server has an error, e.g. 502 Bad Gateway when + // proxied server is temporarily down. See issue #579. + this._emitHttpError(req, res, 'tus: resuming upload resulted in HTTP 500 category error') + return } if (inStatusCategory(status, 400)) {