server: fix SETUP in case of no track ID and query parameters (#623)

This commit is contained in:
Alessandro Ros
2024-09-15 23:24:34 +02:00
committed by GitHub
parent 28f91637d4
commit 6ed93de46c
2 changed files with 15 additions and 0 deletions

View File

@@ -73,6 +73,9 @@ func getPathAndQueryAndTrackID(u *base.URL) (string, string, string, error) {
// no track ID and a trailing slash.
// this happens when trying to read a MPEG-TS stream with FFmpeg.
if strings.HasSuffix(u.RawQuery, "/") {
return u.Path, u.RawQuery[:len(u.RawQuery)-1], "0", nil
}
if strings.HasSuffix(u.Path[1:], "/") {
return u.Path[:len(u.Path)-1], u.RawQuery, "0", nil
}