aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2021-10-25 17:42:20 +0200
committerGitHub <noreply@github.com>2021-10-25 17:42:20 +0200
commit276250f0a36e00373166d91d539e5220d6f158c7 (patch)
tree394e4fd65912edbbe9266ccfbacfc14f433371e7 /server/tests
parentb2ad0090c182c7f2a8cba1cced3987d408a4b159 (diff)
downloadPeerTube-276250f0a36e00373166d91d539e5220d6f158c7.tar.gz
PeerTube-276250f0a36e00373166d91d539e5220d6f158c7.tar.zst
PeerTube-276250f0a36e00373166d91d539e5220d6f158c7.zip
prevent multiple post-process triggering of upload-resumable (#4175)
* prevent multiple post-process triggering of upload-resumable * switch from 409 to 503 for upload being processed * Improve resumable upload check Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/videos/resumable-upload.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/server/tests/api/videos/resumable-upload.ts b/server/tests/api/videos/resumable-upload.ts
index 59970aa94..6b5e0c09d 100644
--- a/server/tests/api/videos/resumable-upload.ts
+++ b/server/tests/api/videos/resumable-upload.ts
@@ -180,6 +180,21 @@ describe('Test resumable upload', function () {
180 await sendChunks({ pathUploadId: uploadId, expectedStatus, contentRangeBuilder, contentLength: size }) 180 await sendChunks({ pathUploadId: uploadId, expectedStatus, contentRangeBuilder, contentLength: size })
181 await checkFileSize(uploadId, 0) 181 await checkFileSize(uploadId, 0)
182 }) 182 })
183
184 it('Should be able to accept 2 PUT requests', async function () {
185 const uploadId = await prepareUpload()
186
187 const result1 = await sendChunks({ pathUploadId: uploadId })
188 const result2 = await sendChunks({ pathUploadId: uploadId })
189
190 expect(result1.body.video.uuid).to.exist
191 expect(result1.body.video.uuid).to.equal(result2.body.video.uuid)
192
193 expect(result1.headers['x-resumable-upload-cached']).to.not.exist
194 expect(result2.headers['x-resumable-upload-cached']).to.equal('true')
195
196 await checkFileSize(uploadId, null)
197 })
183 }) 198 })
184 199
185 after(async function () { 200 after(async function () {