未开启鉴权也要更新状态

This commit is contained in:
xugo
2026-02-06 11:25:17 +08:00
parent 0cbb72bb23
commit d4c9d251d5
+7 -10
View File
@@ -74,16 +74,13 @@ func (a *Adapter) OnPublish(ctx context.Context, app, stream string, params map[
return false, err
}
// 如果通道禁用了鉴权,直接通过
if ch.Config.IsAuthDisabled {
return true, nil
}
// 验证签名
sign := params["sign"]
expectedSign := hook.MD5(a.conf.Server.RTMPSecret)
if sign != expectedSign {
return false, nil
// 如果开启了鉴权
if !ch.Config.IsAuthDisabled {
sign := params["sign"]
expectedSign := hook.MD5(a.conf.Server.RTMPSecret)
if sign != expectedSign {
return false, nil
}
}
// 更新通道推流状态