mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-24 23:10:41 +02:00
hlsts: test playlist segment URLs carry the jwt credential
This commit is contained in:
1 parent
b95b7f5761
commit
fa872adb7f
1 file changed
+14
@@ -133,6 +133,20 @@ movie.ts?format.view=hls-ts&seq=2
|
||||
}
|
||||
}
|
||||
|
||||
func TestViewPlaylistCarriesJwt(t *testing.T) {
|
||||
plan, err := Adapter{}.View(format.ViewRequest{Query: url.Values{"jwt": {"a.b+c/d="}}}, viewObject(t))
|
||||
if err != nil {
|
||||
t.Fatalf("View() error = %v", err)
|
||||
}
|
||||
for _, line := range strings.Split(string(plan.Body), "\n") {
|
||||
if strings.HasSuffix(line, ".ts") || strings.Contains(line, "seq=") {
|
||||
if !strings.Contains(line, "jwt=a.b%2Bc%2Fd%3D") {
|
||||
t.Fatalf("segment URL dropped jwt: %q", line)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestViewSegment(t *testing.T) {
|
||||
obj := viewObject(t)
|
||||
plan, err := Adapter{}.View(format.ViewRequest{Query: url.Values{"seq": {"1"}}}, obj)
|
||||
|
||||
Reference in new issue
Block a user