@uppy/tus: retry on 423 HTTP error code (#4512)

This commit is contained in:
Antoine du Hamel 2023-06-20 11:17:56 +02:00 committed by GitHub
parent 147e5da96f
commit 2b9958c4f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -302,8 +302,10 @@ export default class Tus extends BasePlugin {
}
this.requests.rateLimit(next.value)
}
} else if (status > 400 && status < 500 && status !== 409) {
} else if (status > 400 && status < 500 && status !== 409 && status !== 423) {
// HTTP 4xx, the server won't send anything, it's doesn't make sense to retry
// HTTP 409 Conflict (happens if the Upload-Offset header does not match the one on the server)
// HTTP 423 Locked (happens when a paused download is resumed too quickly)
return false
} else if (typeof navigator !== 'undefined' && navigator.onLine === false) {
// The navigator is offline, let's wait for it to come back online.