🐛 FIX: 使用自有端口后的streamPath前缀斜杠消除

This commit is contained in:
dexter
2022-10-14 16:52:02 +08:00
parent 0034cbb303
commit fcf39a84b9

View File

@@ -119,7 +119,8 @@ func (sub *HDLSubscriber) OnEvent(event any) {
} }
func (*HDLConfig) ServeHTTP(w http.ResponseWriter, r *http.Request) { 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 != "" { if r.URL.RawQuery != "" {
streamPath += "?" + r.URL.RawQuery streamPath += "?" + r.URL.RawQuery
} }