protocol/rtsp: using strings.Prefix in ReadResponse to check that protocol is correct

This commit is contained in:
Saxon 2019-04-30 21:43:04 +09:30
parent a025d55d81
commit e823ebca48
1 changed files with 1 additions and 1 deletions
protocol/rtsp

View File

@ -133,7 +133,7 @@ func ReadResponse(r io.Reader) (*Response, error) {
}
s := scanner.Text()
if len(s) < minResponse || s[:5] != "RTSP/" {
if len(s) < minResponse || !strings.HasPrefix(s, "RTSP/") {
return nil, errInvalidResponse
}
resp.Proto = "RTSP"