support control paths that start with '?'

This commit is contained in:
aler9
2020-11-03 11:40:59 +01:00
parent 1679c10b86
commit 688a39e0e3
2 changed files with 25 additions and 3 deletions

View File

@@ -160,6 +160,12 @@ func (u *URL) SetUser(user *url.Userinfo) {
// AddControlPath adds a control path to a RTSP url.
func (u *URL) AddControlPath(controlPath string) {
// special case: query
if controlPath[0] == '?' {
u.inner.RawQuery += controlPath[1:]
return
}
// always insert the control path at the end of the url
if u.inner.RawQuery != "" {
if !strings.HasSuffix(u.inner.RawQuery, "/") {