Browse Source

reply with 401 when publish key is missing

pull/2/head v0.3.0
aler9 6 years ago
parent
commit
e3ebd21659
  1. 8
      client.go

8
client.go

@ -313,13 +313,9 @@ func (c *client) handleRequest(req *rtsp.Request) bool {
} }
key, ok := q["key"] key, ok := q["key"]
if !ok || len(key) == 0 { if !ok || len(key) != 1 || key[0] != c.p.publishKey {
c.writeResError(req, fmt.Errorf("key missing"))
return false
}
if key[0] != c.p.publishKey {
// reply with 401 and exit // reply with 401 and exit
c.log("ERR: publish key wrong or missing")
c.writeRes(&rtsp.Response{ c.writeRes(&rtsp.Response{
StatusCode: 401, StatusCode: 401,
Status: "Unauthorized", Status: "Unauthorized",

Loading…
Cancel
Save