From fa872adb7f53cef15e7414ad3b0cc3370bfbee9b Mon Sep 17 00:00:00 2001 From: "user.email" Date: Sat, 24 Oct 2026 09:54:32 -0700 Subject: [PATCH] hlsts: test playlist segment URLs carry the jwt credential --- weed/format/hlsts/hlsts_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/weed/format/hlsts/hlsts_test.go b/weed/format/hlsts/hlsts_test.go index 89fd4587ef..129af022e8 100644 --- a/weed/format/hlsts/hlsts_test.go +++ b/weed/format/hlsts/hlsts_test.go @@ -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)