X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fvideos%2Fvideo-static-file-privacy.ts;h=eaaed5aadc6e644339905da29bab2762b75d8caa;hb=5a122dddc5aab1b2ae1843411032d5f392bdd216;hp=bdbe85127bc13902ac3e6e06ec5b51f6e5da1c03;hpb=49e7e4d9ffd16cba7a721f6d3d3203decf4f4b2c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/videos/video-static-file-privacy.ts b/server/tests/api/videos/video-static-file-privacy.ts index bdbe85127..eaaed5aad 100644 --- a/server/tests/api/videos/video-static-file-privacy.ts +++ b/server/tests/api/videos/video-static-file-privacy.ts @@ -383,6 +383,39 @@ describe('Test video static file privacy', function () { }) }) + describe('With static file right check disabled', function () { + let videoUUID: string + + before(async function () { + this.timeout(240000) + + await server.kill() + + await server.run({ + static_files: { + private_files_require_auth: false + } + }) + + const { uuid } = await server.videos.quickUpload({ name: 'video', privacy: VideoPrivacy.INTERNAL }) + videoUUID = uuid + + await waitJobs([ server ]) + }) + + it('Should not check auth for private static files', async function () { + const video = await server.videos.getWithToken({ id: videoUUID }) + + for (const file of getAllFiles(video)) { + await makeRawRequest({ url: file.fileUrl, expectedStatus: HttpStatusCode.OK_200 }) + } + + const hls = video.streamingPlaylists[0] + await makeRawRequest({ url: hls.playlistUrl, expectedStatus: HttpStatusCode.OK_200 }) + await makeRawRequest({ url: hls.segmentsSha256Url, expectedStatus: HttpStatusCode.OK_200 }) + }) + }) + after(async function () { await cleanupTests([ server ]) })