Skip to content

Commit b4e3693

Browse files
committed
Fix HEAD not being retried for HTTP 500 category responses. See #579
1 parent d00cf4b commit b4e3693

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/upload.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,14 @@ class BaseUpload {
616616
this._emitHttpError(req, res, 'tus: upload is currently locked; retry later')
617617
return
618618
}
619+
if (inStatusCategory(status, 500)) {
620+
// Run retry logic if the server has an error, e.g. 502 Bad Gateway when
621+
// proxied server is temporarily down. See issue #579.
622+
// Since we want to retry, do not clear `this.url` and do not
623+
// create a new upload.
624+
this._emitHttpError(req, res, 'tus: resuming upload resulted in HTTP 500 category error')
625+
return
626+
}
619627

620628
if (inStatusCategory(status, 400)) {
621629
// Remove stored fingerprint and corresponding endpoint,

0 commit comments

Comments
 (0)