From fcf39a84b9cd8ac26f06d833dd1e09eed870c57f Mon Sep 17 00:00:00 2001 From: dexter <178529795@qq.com> Date: Fri, 14 Oct 2022 16:52:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E8=87=AA=E6=9C=89=E7=AB=AF=E5=8F=A3=E5=90=8E=E7=9A=84streamPat?= =?UTF-8?q?h=E5=89=8D=E7=BC=80=E6=96=9C=E6=9D=A0=E6=B6=88=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index c53b18c..3b70522 100644 --- a/main.go +++ b/main.go @@ -119,7 +119,8 @@ func (sub *HDLSubscriber) OnEvent(event any) { } func (*HDLConfig) ServeHTTP(w http.ResponseWriter, r *http.Request) { - streamPath := strings.TrimSuffix(strings.TrimPrefix(r.URL.Path, "/hdl/"), ".flv") + streamPath := strings.TrimSuffix(strings.TrimPrefix(r.URL.Path, "/hdl"), ".flv") + streamPath = strings.TrimPrefix(streamPath, "/") if r.URL.RawQuery != "" { streamPath += "?" + r.URL.RawQuery }