From e287b528085bde14e8c360834b3a9534f0a05236 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Fri, 4 Nov 2022 22:12:00 +0300 Subject: [PATCH] Add check for RTSPtoWeb API --- cmd/hass/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/hass/api.go b/cmd/hass/api.go index 61b0a8cc..87939d61 100644 --- a/cmd/hass/api.go +++ b/cmd/hass/api.go @@ -55,6 +55,10 @@ func initAPI() { // /stream/{id}/channel/0/webrtc default: i := strings.IndexByte(r.RequestURI[8:], '/') + if i <= 0 { + log.Warn().Msgf("wrong request: %s", r.RequestURI) + return + } name := r.RequestURI[8 : 8+i] stream := streams.Get(name)