httpgateway: set new max payload length config value
这个提交包含在:
13
config.cpp
13
config.cpp
@@ -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)
|
||||
|
在新工单中引用
屏蔽一个用户