cmd: Better error handling when reloading (#6601)

* caddyhttp: Limit auto-HTTPS error logs to 100 domains

* Improve error message and increase error size limit
This commit is contained in:
Matt Holt 2024-10-01 20:31:30 -06:00 committed by GitHub
parent 9b4acc2449
commit c8adb1b553
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 2 deletions

View file

@ -716,7 +716,7 @@ func AdminAPIRequest(adminAddr, method, uri string, headers http.Header, body io
// if it didn't work, let the user know
if resp.StatusCode >= 400 {
respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1024*10))
respBody, err := io.ReadAll(io.LimitReader(resp.Body, 1024*1024*2))
if err != nil {
return nil, fmt.Errorf("HTTP %d: reading error message: %v", resp.StatusCode, err)
}