]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/shared/streaming-playlists.ts
Fix file token reinjection on fragments
[github/Chocobozzz/PeerTube.git] / server / tests / shared / streaming-playlists.ts
index 5c62af812ead06679fa2dedd746cb6023a610f0f..1c38cb512ef99695add6b746f8a8dbcc54ee2898 100644 (file)
@@ -40,6 +40,8 @@ async function checkSegmentHash (options: {
   expect(sha256(segmentBody)).to.equal(shaBody[videoName][range])
 }
 
+// ---------------------------------------------------------------------------
+
 async function checkLiveSegmentHash (options: {
   server: PeerTubeServer
   baseUrlSegment: string
@@ -56,6 +58,8 @@ async function checkLiveSegmentHash (options: {
   expect(sha256(segmentBody)).to.equal(shaBody[segmentName])
 }
 
+// ---------------------------------------------------------------------------
+
 async function checkResolutionsInMasterPlaylist (options: {
   server: PeerTubeServer
   playlistUrl: string
@@ -210,7 +214,7 @@ async function checkVideoFileTokenReinjection (options: {
       ? i
       : `-${resolution}`
 
-    expect(text).to.contain(`${suffix}.m3u8?videoFileToken=${videoFileToken}`)
+    expect(text).to.contain(`${suffix}.m3u8?videoFileToken=${videoFileToken}&reinjectVideoFileToken=true`)
   }
 
   const resolutionPlaylists = extractResolutionPlaylistUrls(hls.playlistUrl, text)
@@ -224,6 +228,7 @@ async function checkVideoFileTokenReinjection (options: {
       : '.mp4'
 
     expect(text).to.contain(`${extension}?videoFileToken=${videoFileToken}`)
+    expect(text).not.to.contain(`reinjectVideoFileToken=true`)
   }
 }