mirror of
https://github.com/caddyserver/caddy.git
synced 2026-04-26 18:59:50 -04:00
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:
parent
cf42f61566
commit
48c08e3890
3
admin.go
3
admin.go
@ -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{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user