Skip to main content

MAX_DECOMPRESSED_REQUEST_SIZE

Constant MAX_DECOMPRESSED_REQUEST_SIZE 

Source
pub const MAX_DECOMPRESSED_REQUEST_SIZE: usize = _; // 536_870_912usize
Expand description

Hard cap on the decompressed size of a handler-decompressed request body (Prometheus remote read/write, Loki push).

The HTTP body limit only bounds the encoded bytes on the wire. Without this cap a tiny compressed payload (e.g. a five-byte raw-Snappy varint or a few KiB of zstd RLE blocks) could declare/expand to multiple GiB of heap before any protobuf validation runs, so the decompressed size must be bounded on its own.