'Generic Commit'
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 1m20s
Build-Test-Publish / build (linux/arm64) (push) Successful in 2m1s
Build-Test-Publish / create-manifest (push) Successful in 14s

This commit is contained in:
Your Name
2025-06-15 16:37:57 +12:00
parent a4d9e3ebb5
commit bf9f714a3d
4 changed files with 47 additions and 14 deletions

View File

@@ -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"}};

View File

@@ -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