From a41c2fc67c47750ff602b1dcbdc2b3750e1a1f3b Mon Sep 17 00:00:00 2001 From: aler9 <46489434+aler9@users.noreply.github.com> Date: Sun, 27 Sep 2020 13:02:36 +0200 Subject: [PATCH] check SETUP mode when reading --- client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client.go b/client.go index e0e3d551..031ca0fb 100644 --- a/client.go +++ b/client.go @@ -472,6 +472,11 @@ func (c *client) handleRequest(req *gortsplib.Request) error { switch c.state { // play case clientStateInitial, clientStatePrePlay: + if th.Mode != nil && *th.Mode != "play" { + c.writeResError(cseq, gortsplib.StatusBadRequest, fmt.Errorf("transport header must contain mode=play or not contain a mode")) + return errRunTerminate + } + pathConf, err := c.p.conf.checkPathNameAndFindConf(basePath) if err != nil { c.writeResError(cseq, gortsplib.StatusBadRequest, err)