mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
新增http api与http文件访问ip白名单限制机制,默认禁止公网访问
This commit is contained in:
@@ -238,6 +238,11 @@ static inline void addHttpListener(){
|
||||
//该api已被消费
|
||||
consumed = true;
|
||||
|
||||
if (!HttpFileManager::isIPAllowed(sender.get_peer_ip())) {
|
||||
invoker(403, HttpSession::KeyValue(), "Your ip is not allowed to access the service.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(api_debug){
|
||||
auto newInvoker = [invoker, parser](int code, const HttpSession::KeyValue &headerOut, const HttpBody::Ptr &body) {
|
||||
//body默认为空
|
||||
|
||||
Reference in New Issue
Block a user