httpgateway: set new max payload length config value

这个提交包含在:
2019-05-04 00:02:17 +02:00
父节点 8fe7e98aaa
当前提交 93aea9ed7b
共有 4 个文件被更改,包括 21 次插入1 次删除

查看文件

@@ -53,6 +53,17 @@ int Config::optional(const std::string &key, int defaultvalue)
return defaultvalue;
}
uint64_t Config::optional(const std::string &key, uint64_t defaultvalue)
{
auto it = this->configmap.find(key);
if(it != this->configmap.end())
{
std::string str = it->second;
return static_cast<uint64_t>(std::stoull(str));
}
return defaultvalue;
}
Config::Config(const std::map<std::string, std::string> &map)
{
@@ -93,6 +104,8 @@ Config::Config(const std::map<std::string, std::string> &map)
this->anon_permissions = Permissions(required("anon_permissions"));
this->templateprefix = "{qswiki:";
this->max_payload_length = optional("max_payload_length", 10 * 1024 * 1024);
}
ConfigReader::ConfigReader(const std::string &file)