rest-server: increase max body size

Increase maximum POST request body size from 64 kiB to 512 kiB to
match the value used in pve-http-server [0]. This change addresses
potential limitations with the newly introduced consent-banner
feature, which can contain lots of text that could approach the
previous limits [1].

[0]: https://git.proxmox.com/?p=pve-http-server.git;a=commit;h=2650923a42c9ea357dc0e663a69294410190cc7c
[1]: https://lore.proxmox.com/pbs-devel/e0cfec76-5149-4d3d-80be-b96ae633e1ee@proxmox.com/

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
Link: https://lore.proxmox.com/20250408132626.381476-1-g.goller@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Gabriel Goller 2025-04-08 15:26:26 +02:00 committed by Thomas Lamprecht
parent 22ffd650c2
commit cf9e6c03a0

View File

@ -405,8 +405,7 @@ async fn get_request_parameters<S: 'static + BuildHasher + Send>(
http_err!(BAD_REQUEST, "Problems reading request body: {}", err)
})
.try_fold(Vec::new(), |mut acc, chunk| async move {
// FIXME: max request body size?
if acc.len() + chunk.len() < 64 * 1024 {
if acc.len() + chunk.len() < 512 * 1024 {
acc.extend_from_slice(&chunk);
Ok(acc)
} else {