This commit is contained in:
aler9
2020-07-12 20:05:00 +02:00
parent f3bea8ccb9
commit 98a412add6

View File

@@ -155,7 +155,8 @@ func (c *ConnClient) WriteFrame(frame *InterleavedFrame) error {
}
// Options writes an OPTIONS request and reads a response, that contains
// the methods allowed by the server.
// the methods allowed by the server. Since this method is not implemented by
// every RTSP server, the function does not fail if the returned code is StatusNotFound.
func (c *ConnClient) Options(u *url.URL) (*Response, error) {
// strip path
u = &url.URL{
@@ -173,7 +174,6 @@ func (c *ConnClient) Options(u *url.URL) (*Response, error) {
return nil, err
}
// OPTIONS is not available in some cameras, so StatusNotFound is not an error
if res.StatusCode != StatusOK && res.StatusCode != StatusNotFound {
return nil, fmt.Errorf("bad status code: %d (%s)", res.StatusCode, res.StatusMessage)
}