mirror of
https://github.com/gowvp/gb28181.git
synced 2026-04-22 23:17:19 +08:00
未开启鉴权也要更新状态
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
// 更新通道推流状态
|
||||
|
||||
Reference in New Issue
Block a user