caddyhttp: Default max_header_bytes to 16 KiB

This commit is contained in:
Matthew Holt
2026-06-09 12:07:18 -06:00
parent 55b3397a2d
commit 4fd8c87f56
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -257,6 +257,12 @@ func (app *App) Provision(ctx caddy.Context) error {
}
}
// limit max header bytes to a more reasonable default than 1MB from Go std lib
// (see https://github.com/php/frankenphp/issues/2459#issuecomment-4655612909)
if srv.MaxHeaderBytes <= 0 {
srv.MaxHeaderBytes = 16 * 1024
}
// if not explicitly configured by the user, disallow TLS
// client auth bypass (domain fronting) which could
// otherwise be exploited by sending an unprotected SNI
+1 -1
View File
@@ -101,7 +101,7 @@ type Server struct {
KeepAliveCount int `json:"keepalive_count,omitempty"`
// MaxHeaderBytes is the maximum size to parse from a client's
// HTTP request headers.
// HTTP request headers. Default: 16 KiB.
MaxHeaderBytes int `json:"max_header_bytes,omitempty"`
// Enable full-duplex communication for HTTP/1 requests.