mirror of https://bitbucket.org/ausocean/av.git
protocol/rtsp: using strings.Prefix in ReadResponse to check that protocol is correct
This commit is contained in:
parent
a025d55d81
commit
e823ebca48
|
@ -133,7 +133,7 @@ func ReadResponse(r io.Reader) (*Response, error) {
|
||||||
}
|
}
|
||||||
s := scanner.Text()
|
s := scanner.Text()
|
||||||
|
|
||||||
if len(s) < minResponse || s[:5] != "RTSP/" {
|
if len(s) < minResponse || !strings.HasPrefix(s, "RTSP/") {
|
||||||
return nil, errInvalidResponse
|
return nil, errInvalidResponse
|
||||||
}
|
}
|
||||||
resp.Proto = "RTSP"
|
resp.Proto = "RTSP"
|
||||||
|
|
Loading…
Reference in New Issue