Skip to content

Commit c5b2e11

Browse files
Copilotmrhegemon
andcommitted
Increase request size limit from 10MB to 30MB
Co-authored-by: mrhegemon <5104160+mrhegemon@users.noreply.github.com>
1 parent 163c4fb commit c5b2e11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ HttpRequest parse_http_request(const std::string& request) {
113113
}
114114

115115
// Parse body based on Content-Length with validation
116-
const size_t MAX_REQUEST_SIZE = 10 * 1024 * 1024; // 10MB
116+
const size_t MAX_REQUEST_SIZE = 30 * 1024 * 1024; // 30MB
117117
try {
118118
if (req.headers.find("Content-Length") != req.headers.end()) {
119119
long content_length = std::stol(req.headers["Content-Length"]);
@@ -491,7 +491,7 @@ std::string handle_status() {
491491

492492
// Handle client connection with security protections
493493
void handle_client(int client_socket) {
494-
const size_t MAX_REQUEST_SIZE = 10 * 1024 * 1024; // 10MB
494+
const size_t MAX_REQUEST_SIZE = 30 * 1024 * 1024; // 30MB
495495
const int READ_TIMEOUT_SEC = 30;
496496

497497
// Set socket timeout to prevent slowloris attacks

0 commit comments

Comments
 (0)