From ab22cac85bda02472604ff74a182904a75c9339b Mon Sep 17 00:00:00 2001 From: PioLing <964472638@qq.com> Date: Thu, 29 Aug 2024 10:58:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=BC=E5=AE=B9whip?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3http=E5=A4=B4=E7=9A=84=20Authorization=20?= =?UTF-8?q?=E7=9A=84Bearer=E4=BB=A4=E7=89=8C=20(#3849)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增兼容whip接口http头的 Authorization 的Bearer令牌 转成 webhook 的 params的参数 , 即也支持rtc应用业务层回调推流 Authorization Bearer鉴权 --- server/WebApi.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index d699f1ce..2eeac6f8 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -1845,8 +1845,9 @@ void installWebApi() { auto &allArgs = _args; CHECK_ARGS("app", "stream"); - return StrPrinter << "rtc://" << _args["Host"] << "/" << _args["app"] << "/" - << _args["stream"] << "?" << _args.parser.params() + "&session=" + _session_id; + string auth = _args["Authorization"]; // Authorization Bearer + return StrPrinter << "rtc://" << _args["Host"] << "/" << _args["app"] << "/" << _args["stream"] << "?" + << _args.parser.params() + "&session=" + _session_id + (auth.empty() ? "" : ("&Authorization=" + auth)); } private: