mirror of
https://github.com/coredns/coredns.git
synced 2026-06-04 08:10:10 -04:00
core: bound HTTP/3 request header size for DoH3 (#8135)
This PR Set a conservative MaxHeaderBytes value on the DoH3 HTTP/3 server. This reduces memory exposure from large request headers before requests reach the DoH handler. Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
@@ -26,6 +26,8 @@ import (
|
||||
const (
|
||||
// DefaultHTTPS3MaxStreams is the default maximum number of concurrent QUIC streams per connection.
|
||||
DefaultHTTPS3MaxStreams = 256
|
||||
// DefaultHTTPS3MaxHeaderBytes limits HTTP/3 header memory before requests reach the DoH handler.
|
||||
DefaultHTTPS3MaxHeaderBytes = 16 << 10 // 16 KiB
|
||||
)
|
||||
|
||||
// ServerHTTPS3 represents a DNS-over-HTTP/3 server.
|
||||
@@ -91,6 +93,7 @@ func NewServerHTTPS3(addr string, group []*Config) (*ServerHTTPS3, error) {
|
||||
TLSConfig: tlsConfig,
|
||||
EnableDatagrams: true,
|
||||
QUICConfig: qconf,
|
||||
MaxHeaderBytes: DefaultHTTPS3MaxHeaderBytes,
|
||||
// Logger: stdlog.New(&loggerAdapter{}, "", 0), TODO: Fix it
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user