mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-05 08:16:55 +08:00
Add check on RTSP server requers with empty url path
This commit is contained in:
@@ -140,6 +140,11 @@ func tcpHandler(c net.Conn) {
|
|||||||
|
|
||||||
switch msg {
|
switch msg {
|
||||||
case rtsp.MethodDescribe:
|
case rtsp.MethodDescribe:
|
||||||
|
if len(conn.URL.Path) == 0 {
|
||||||
|
log.Warn().Msg("[rtsp] server empty URL on DESCRIBE")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
name = conn.URL.Path[1:]
|
name = conn.URL.Path[1:]
|
||||||
|
|
||||||
stream := streams.Get(name)
|
stream := streams.Get(name)
|
||||||
@@ -161,6 +166,11 @@ func tcpHandler(c net.Conn) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case rtsp.MethodAnnounce:
|
case rtsp.MethodAnnounce:
|
||||||
|
if len(conn.URL.Path) == 0 {
|
||||||
|
log.Warn().Msg("[rtsp] server empty URL on ANNOUNCE")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
name = conn.URL.Path[1:]
|
name = conn.URL.Path[1:]
|
||||||
|
|
||||||
stream := streams.Get(name)
|
stream := streams.Get(name)
|
||||||
|
Reference in New Issue
Block a user