mirror of
https://github.com/caddyserver/caddy.git
synced 2026-08-12 19:31:52 +02:00
caddyhttp: Default max_header_bytes to 16 KiB
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user