admin: Limit config size (by @omercnet)

GitHub was giving me errors related to merge status so we are doing this instead
This commit is contained in:
Matthew Holt 2026-04-24 11:28:40 -06:00
parent cf42f61566
commit 48c08e3890
No known key found for this signature in database

View File

@ -1063,6 +1063,9 @@ func handleConfig(w http.ResponseWriter, r *http.Request) error {
buf.Reset()
defer bufPool.Put(buf)
const maxConfigSize = 100 * 1024 * 1024 // 100 MB
r.Body = http.MaxBytesReader(w, r.Body, maxConfigSize)
_, err := io.Copy(buf, r.Body)
if err != nil {
return APIError{