Skip to content

Commit e3ebd21

Browse files
committed
reply with 401 when publish key is missing
1 parent 7791827 commit e3ebd21

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

client.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,9 @@ func (c *client) handleRequest(req *rtsp.Request) bool {
313313
}
314314

315315
key, ok := q["key"]
316-
if !ok || len(key) == 0 {
317-
c.writeResError(req, fmt.Errorf("key missing"))
318-
return false
319-
}
320-
321-
if key[0] != c.p.publishKey {
316+
if !ok || len(key) != 1 || key[0] != c.p.publishKey {
322317
// reply with 401 and exit
318+
c.log("ERR: publish key wrong or missing")
323319
c.writeRes(&rtsp.Response{
324320
StatusCode: 401,
325321
Status: "Unauthorized",

0 commit comments

Comments
 (0)