httpgateway: set new max payload length config value
This commit is contained in:
@ -33,6 +33,8 @@ HttpGateway::HttpGateway(const Config &config)
|
||||
throw new std::runtime_error("No http.listenport in config file");
|
||||
}
|
||||
this->listenport = std::stoi(listenport);
|
||||
|
||||
this->maxPayloadLength = config.max_payload_length;
|
||||
}
|
||||
|
||||
bool HttpGateway::keepReading()
|
||||
@ -90,7 +92,7 @@ httplib::Response HttpGateway::convertResponse(Response response)
|
||||
void HttpGateway::work(RequestWorker &worker)
|
||||
{
|
||||
httplib::Server server;
|
||||
|
||||
server.set_payload_max_length(this->maxPayloadLength);
|
||||
auto handler = [&](const httplib::Request &req, httplib::Response &res) {
|
||||
Request wikiRequest = convertRequest(req);
|
||||
Logger::debug() << "httpgateway: received request " << wikiRequest;
|
||||
|
@ -16,6 +16,7 @@ class HttpGateway : public GatewayInterface
|
||||
|
||||
std::string listenaddr;
|
||||
int listenport;
|
||||
uint64_t maxPayloadLength;
|
||||
|
||||
public:
|
||||
HttpGateway(const Config &config);
|
||||
|
Reference in New Issue
Block a user