fix: cap body limits at 1GiB and key script clients by the exact size

This commit is contained in:
aykhans committed 2026-09-29 00:55:04 +04:00
1 parent 1956eb1c44
commit ef5907dc0c
5 files changed
+44 -35

No files matched your search

+3 -2
View File
@@ -6,8 +6,9 @@ import (
"strings"
)
// ByteSizeLimit is the largest size any option may ask for, 1 TiB, less where int is 32 bit.
const ByteSizeLimit = min(1<<40, math.MaxInt)
// ByteSizeLimit is the largest size any option may ask for. A limit is also the most
// memory one response may take, so it stays well under what a machine can hold.
const ByteSizeLimit = 1 << 30 // 1 GiB
// RemoteFetchLimit bounds a file sarin downloads for itself, such as a config file or a script.
const RemoteFetchLimit = 64 << 20 // 64 MiB