From d4c9d251d55ea410860f25b0a921a16d53894dac Mon Sep 17 00:00:00 2001 From: xugo Date: Fri, 6 Feb 2026 11:25:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AA=E5=BC=80=E5=90=AF=E9=89=B4=E6=9D=83?= =?UTF-8?q?=E4=B9=9F=E8=A6=81=E6=9B=B4=E6=96=B0=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/adapter/rtmpadapter/rtmp.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/internal/adapter/rtmpadapter/rtmp.go b/internal/adapter/rtmpadapter/rtmp.go index 5760f54..abcbfa1 100644 --- a/internal/adapter/rtmpadapter/rtmp.go +++ b/internal/adapter/rtmpadapter/rtmp.go @@ -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 + } } // 更新通道推流状态