Skip to content

token contains ? twice when the m3u8 file contains ? #90

Open
@RamirezTuco

Description

@RamirezTuco

Hi,

We are using the nginx-secure-token-module and it seems to work perfectly when the m3u8 file does not contain any '?' in the ts, but if it contains '?', the '?' is appended twice.

I have attached

  1. nginx.txt
  2. playlist11.txt
  3. playlist12.txt
    nginx.txt
    playlist11.txt
    playlist12.txt

The playlist files should be renamed to m3u8 extension, and placed in "/var/www/html/video/" folder.
nginx.txt should be renamed to nginx.conf.

Thereafter, after starting the server, we hit two urls.

curl -X GET 'http://localhost/video/playlist11.m3u8?__hdnea__=abc'

The above gives output

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:11
#EXTINF:10.343667,
z_video1_cuhunk_0.ts?hdnea=st=1608196639exp=1608283039acl=/*hmac=b0ba41f5206c1965c0e8bf423192230bdd042016becd5640a56097be5d2b62fe
#EXTINF:9.776433,
z_video1_cuhunk_1.ts?hdnea=st=1608196639
exp=1608283039acl=/*hmac=b0ba41f5206c1965c0e8bf423192230bdd042016becd5640a56097be5d2b62fe
#EXTINF:9.976633,
z_video1_cuhunk_2.ts?hdnea=st=1608196639
exp=1608283039
acl=/*~hmac=b0ba41f5206c1965c0e8bf423192230bdd042016becd5640a56097be5d2b62fe
#EXT-X-ENDLIST

The second url
curl -X GET 'http://localhost/video/playlist12.m3u8?__hdnea__=abc'

gives the wrong output, as it appends '?' twice.

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-ALLOW-CACHE:YES
#EXT-X-TARGETDURATION:11
#EXTINF:10.343667,
z_video1_cuhunk_0.ts?a=b?hdnea=st=1608196781exp=1608283181acl=/*hmac=d55c2028f8bc4dca8f6e3811349a627f3e4855ffcf6cf44cc67d154ef4160824
#EXTINF:9.776433,
z_video1_cuhunk_1.ts?a=b?hdnea=st=1608196781
exp=1608283181acl=/*hmac=d55c2028f8bc4dca8f6e3811349a627f3e4855ffcf6cf44cc67d154ef4160824
#EXTINF:9.976633,
z_video1_cuhunk_2.ts?a=b?hdnea=st=1608196781
exp=1608283181
acl=/*~hmac=d55c2028f8bc4dca8f6e3811349a627f3e4855ffcf6cf44cc67d154ef4160824
#EXT-X-ENDLIST

It is because the playlist12.m3u8 has ?a=b in it. For simplicity, i have disabled the validation.
Is it a bug or am i doing something wrong here?

There seem to be other issues raised who have raised this, like this and this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions