Skip to content

Commit

Permalink
Fix HEAD not being retried for HTTP 500 category responses. See #579
Browse files Browse the repository at this point in the history
  • Loading branch information
nh2 committed Apr 15, 2023
1 parent d00cf4b commit b4e3693
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,14 @@ class BaseUpload {
this._emitHttpError(req, res, 'tus: upload is currently locked; retry later')
return
}
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.
// Since we want to retry, do not clear `this.url` and do not
// create a new upload.
this._emitHttpError(req, res, 'tus: resuming upload resulted in HTTP 500 category error')
return
}

if (inStatusCategory(status, 400)) {
// Remove stored fingerprint and corresponding endpoint,
Expand Down

0 comments on commit b4e3693

Please sign in to comment.