m3u8 relative url fixed (urls starting with // and urls with query string)
This commit is contained in:
committed by
Alessandro Ros
parent
6dc11c2906
commit
c3a1ee72bc
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user