mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-06 10:57:50 +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);
|
||||
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");
|
||||
try {
|
||||
CHECK_SECRET();
|
||||
// 校验secret成功,文件下载鉴权成功
|
||||
file_invoker("", "", 0);
|
||||
} 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){
|
||||
CHECK_SECRET();
|
||||
CHECK_ARGS("timeout_ms");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user