mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-05-06 23:33:47 +08:00
http access事件新增文件绝对路径参数
This commit is contained in:
@@ -2379,7 +2379,7 @@ void installWebApi() {
|
||||
// 校验secret成功,文件下载鉴权成功
|
||||
file_invoker("", "", 0);
|
||||
} catch (...) {
|
||||
bool flag = NOTICE_EMIT(BroadcastHttpAccessArgs, Broadcast::kBroadcastHttpAccess, allArgs.parser, file_path, false, file_invoker, sender);
|
||||
bool flag = NOTICE_EMIT(BroadcastHttpAccessArgs, Broadcast::kBroadcastHttpAccess, allArgs.parser, allArgs.parser.url(), file_path, false, file_invoker, sender);
|
||||
if (!flag) {
|
||||
// 文件下载鉴权事件无人监听,不允许下载 [AUTO-TRANSLATED:5e02f0ce]
|
||||
// No one is listening to the file download authentication event, download is not allowed
|
||||
|
||||
@@ -783,7 +783,7 @@ void installWebHook() {
|
||||
// The purpose of tracking users is to cache the last authentication result, reduce the number of authentication times, and improve performance
|
||||
NoticeCenter::Instance().addListener(&web_hook_tag, Broadcast::kBroadcastHttpAccess, [](BroadcastHttpAccessArgs) {
|
||||
#if defined(ENABLE_PYTHON)
|
||||
if (PythonInvoker::Instance().on_http_access(parser, path, is_dir, invoker, sender)) {
|
||||
if (PythonInvoker::Instance().on_http_access(parser, path, file_path, is_dir, invoker, sender)) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -806,6 +806,7 @@ void installWebHook() {
|
||||
body["port"] = sender.get_peer_port();
|
||||
body["id"] = sender.getIdentifier();
|
||||
body["path"] = path;
|
||||
body["file_path"] = file_path;
|
||||
body["is_dir"] = is_dir;
|
||||
body["params"] = parser.params();
|
||||
for (auto &pr : parser.getHeader()) {
|
||||
|
||||
@@ -692,7 +692,7 @@ bool PythonInvoker::on_http_access(BroadcastHttpAccessArgs) const {
|
||||
if (!_on_http_access) {
|
||||
return false;
|
||||
}
|
||||
return _on_http_access(to_python_ref(parser), path, is_dir, to_python(invoker), to_python(sender)).cast<bool>();
|
||||
return _on_http_access(to_python_ref(parser), path, file_path, is_dir, to_python(invoker), to_python(sender)).cast<bool>();
|
||||
}
|
||||
|
||||
bool PythonInvoker::on_rtp_server_timeout(BroadcastRtpServerTimeoutArgs) const {
|
||||
|
||||
Reference in New Issue
Block a user