From e823ebca48166c7b8e570bdfd11f2835c39dc529 Mon Sep 17 00:00:00 2001 From: Saxon <saxon@ausocean.org> Date: Tue, 30 Apr 2019 21:43:04 +0930 Subject: [PATCH] protocol/rtsp: using strings.Prefix in ReadResponse to check that protocol is correct --- protocol/rtsp/rtsp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol/rtsp/rtsp.go b/protocol/rtsp/rtsp.go index 7f032967..1ca0cec5 100644 --- a/protocol/rtsp/rtsp.go +++ b/protocol/rtsp/rtsp.go @@ -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"