Fixed file size limit of 2^31-2.
All checks were successful
/ Build the server (push) Successful in 7m8s

This commit is contained in:
Mutzi 2024-04-13 12:26:01 +02:00
parent b75c672c0f
commit 2a1c3a9f72
Signed by: root
GPG Key ID: 2437494E09F13876

View File

@ -93,7 +93,7 @@ void Server::upload(const std::shared_ptr<restbed::Session> &s) {
auto node = get_node(user, node_id);
if (!node) return s->close(400, "Invalid node");
if (!node->file) return s->close(400, "Can't upload to a directory");
std::size_t to_read = req->get_header("Content-Length", 0);
auto to_read = req->get_header<std::size_t>("Content-Length", 0);
auto path = user->user_dir / std::to_string(node->id);
if (node->preview) {
node->preview = false;