mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-25 20:41:59 -08:00
m3u8 relative url fixed (urls starting with // and urls with query string)
This commit is contained in:
parent
6dc11c2906
commit
c3a1ee72bc
1 changed files with 8 additions and 5 deletions
|
|
@ -34,12 +34,15 @@ func clientURLAbsolute(base *url.URL, relative string) (*url.URL, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
if !u.IsAbs() {
|
||||
if strings.HasPrefix(relative, "//") {
|
||||
u.Scheme = base.Scheme
|
||||
} else if !u.IsAbs() {
|
||||
u = &url.URL{
|
||||
Scheme: base.Scheme,
|
||||
User: base.User,
|
||||
Host: base.Host,
|
||||
Path: gopath.Join(gopath.Dir(base.Path), relative),
|
||||
Scheme: base.Scheme,
|
||||
User: base.User,
|
||||
Host: base.Host,
|
||||
Path: gopath.Join(gopath.Dir(base.Path), u.Path),
|
||||
RawQuery: u.RawQuery,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue