新增兼容whip接口http头的 Authorization 的Bearer令牌 (#3849)

新增兼容whip接口http头的 Authorization 的Bearer令牌 转成 webhook 的 params的参数 ,
即也支持rtc应用业务层回调推流 Authorization Bearer鉴权
This commit is contained in:
PioLing 2024-08-29 10:58:51 +08:00 committed by GitHub
parent df9dd3d17a
commit ab22cac85b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: