mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-13 09:06:41 +00: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
1 changed files with 3 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue