mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-20 00:37:49 +08:00
downloadFile http api支持secret鉴权
This commit is contained in:
parent
eef858ffd3
commit
f48caf90e8
@ -2374,15 +2374,20 @@ void installWebApi() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool flag = NOTICE_EMIT(BroadcastHttpAccessArgs, Broadcast::kBroadcastHttpAccess, allArgs.parser, file_path, false, file_invoker, sender);
|
try {
|
||||||
if (!flag) {
|
CHECK_SECRET();
|
||||||
// 文件下载鉴权事件无人监听,不允许下载 [AUTO-TRANSLATED:5e02f0ce]
|
// 校验secret成功,文件下载鉴权成功
|
||||||
// No one is listening to the file download authentication event, download is not allowed
|
file_invoker("", "", 0);
|
||||||
invoker(401, StrCaseMap {}, "None http access event listener");
|
} catch (...) {
|
||||||
|
bool flag = NOTICE_EMIT(BroadcastHttpAccessArgs, Broadcast::kBroadcastHttpAccess, allArgs.parser, 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
|
||||||
|
invoker(401, StrCaseMap {}, "None http access event listener");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
api_regist("/index/api/searchOnvifDevice",[](API_ARGS_MAP_ASYNC){
|
api_regist("/index/api/searchOnvifDevice",[](API_ARGS_MAP_ASYNC){
|
||||||
CHECK_SECRET();
|
CHECK_SECRET();
|
||||||
CHECK_ARGS("timeout_ms");
|
CHECK_ARGS("timeout_ms");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user