新增http api与http文件访问ip白名单限制机制,默认禁止公网访问

This commit is contained in:
xia-chu
2023-07-26 16:33:21 +08:00
parent e8f8b48d38
commit 098046cb1d
6 changed files with 77 additions and 2 deletions

View File

@@ -165,6 +165,7 @@ const string kDirMenu = HTTP_FIELD "dirMenu";
const string kForbidCacheSuffix = HTTP_FIELD "forbidCacheSuffix";
const string kForwardedIpHeader = HTTP_FIELD "forwarded_ip_header";
const string kAllowCrossDomains = HTTP_FIELD "allow_cross_domains";
const string kAllowIPRange = HTTP_FIELD "allow_ip_range";
static onceToken token([]() {
mINI::Instance()[kSendBufSize] = 64 * 1024;
@@ -193,6 +194,7 @@ static onceToken token([]() {
mINI::Instance()[kForbidCacheSuffix] = "";
mINI::Instance()[kForwardedIpHeader] = "";
mINI::Instance()[kAllowCrossDomains] = 1;
mINI::Instance()[kAllowIPRange] = "127.0.0.1,172.16.0.0-172.31.255.255,192.168.0.0-192.168.255.255";
});
} // namespace Http