Merge pull request #9 from ciuncan/master

Fix #8 - Do options request to resource path rather than /
This commit is contained in:
Alessandro Ros
2020-10-16 23:00:35 +02:00
committed by GitHub

View File

@@ -351,12 +351,12 @@ func (c *ConnClient) Options(u *url.URL) (*base.Response, error) {
res, err := c.Do(&base.Request{ res, err := c.Do(&base.Request{
Method: base.OPTIONS, Method: base.OPTIONS,
// strip path
Url: &url.URL{ Url: &url.URL{
Scheme: "rtsp", Scheme: "rtsp",
Host: u.Host, Host: u.Host,
User: u.User, User: u.User,
Path: "/", // use the stream path, otherwise some cameras do not reply
Path: u.Path,
}, },
}) })
if err != nil { if err != nil {
@@ -776,7 +776,8 @@ func (c *ConnClient) LoopUDP() error {
Scheme: "rtsp", Scheme: "rtsp",
Host: c.streamUrl.Host, Host: c.streamUrl.Host,
User: c.streamUrl.User, User: c.streamUrl.User,
Path: "/", // use the stream path, otherwise some cameras do not reply
Path: c.streamUrl.Path,
}, },
SkipResponse: true, SkipResponse: true,
}) })