'Generic Commit'
This commit is contained in:
@@ -51,7 +51,7 @@ void PutHandler::handle_put_object(const drogon::HttpRequestPtr& req, std::funct
|
||||
if (!contentLengthHeader.empty()) {
|
||||
try {
|
||||
size_t contentLength = std::stoull(contentLengthHeader);
|
||||
const size_t MAX_UPLOAD_SIZE = 2ULL * 1024 * 1024 * 1024; // 2GB
|
||||
const size_t MAX_UPLOAD_SIZE = 6ULL * 1024 * 1024 * 1024; // 6GB
|
||||
if (contentLength > MAX_UPLOAD_SIZE) {
|
||||
resp->setStatusCode(drogon::k413RequestEntityTooLarge);
|
||||
nlohmann::json response = {{"result", "error"}, {"error", "File too large"}};
|
||||
|
@@ -146,8 +146,8 @@ bool Server::start() {
|
||||
drogon::app().addListener(config_.host, config_.port);
|
||||
drogon::app().setThreadNum(16);
|
||||
|
||||
// Set security limits (allowing for 1GB+ files for testing)
|
||||
drogon::app().setClientMaxBodySize(2ULL * 1024 * 1024 * 1024); // 2GB max body size
|
||||
// Set security limits (allowing for large files up to 6GB)
|
||||
drogon::app().setClientMaxBodySize(6ULL * 1024 * 1024 * 1024); // 6GB max body size
|
||||
drogon::app().setClientMaxMemoryBodySize(100 * 1024 * 1024); // 100MB max memory body (keep this lower)
|
||||
drogon::app().enableGzip(true); // Enable compression
|
||||
|
||||
|
Reference in New Issue
Block a user