server: fix reading with ffplay and stateless ipv6

This commit is contained in:
aler9
2022-04-21 13:15:11 +02:00
parent d2380aeed1
commit 1e612f2443
2 changed files with 28 additions and 0 deletions

View File

@@ -14,6 +14,30 @@ func mustParseURL(s string) *URL {
return u
}
func TestURLParse(t *testing.T) {
for _, ca := range []struct {
name string
enc string
u *URL
}{
{
"ipv6 stateless",
`rtsp://[fe80::a8f4:3219:f33e:a072%wl0]:8554/proxied`,
&URL{
Scheme: "rtsp",
Host: "[fe80::a8f4:3219:f33e:a072%wl0]:8554",
Path: "/proxied",
},
},
} {
t.Run(ca.name, func(t *testing.T) {
u, err := ParseURL(ca.enc)
require.NoError(t, err)
require.Equal(t, ca.u, u)
})
}
}
func TestURLParseErrors(t *testing.T) {
for _, ca := range []struct {
name string