@@ -401,6 +401,9 @@ func (app *App) Provision(ctx caddy.Context) error {
401
401
if srv .IdleTimeout == 0 {
402
402
srv .IdleTimeout = defaultIdleTimeout
403
403
}
404
+ if srv .ReadHeaderTimeout == 0 {
405
+ srv .ReadHeaderTimeout = defaultReadHeaderTimeout // see #6663
406
+ }
404
407
}
405
408
ctx .Context = oldContext
406
409
return nil
@@ -770,11 +773,20 @@ func (app *App) httpsPort() int {
770
773
return app .HTTPSPort
771
774
}
772
775
773
- // defaultIdleTimeout is the default HTTP server timeout
774
- // for closing idle connections; useful to avoid resource
775
- // exhaustion behind hungry CDNs, for example (we've had
776
- // several complaints without this).
777
- const defaultIdleTimeout = caddy .Duration (5 * time .Minute )
776
+ const (
777
+ // defaultIdleTimeout is the default HTTP server timeout
778
+ // for closing idle connections; useful to avoid resource
779
+ // exhaustion behind hungry CDNs, for example (we've had
780
+ // several complaints without this).
781
+ defaultIdleTimeout = caddy .Duration (5 * time .Minute )
782
+
783
+ // defaultReadHeaderTimeout is the default timeout for
784
+ // reading HTTP headers from clients. Headers are generally
785
+ // small, often less than 1 KB, so it shouldn't take a
786
+ // long time even on legitimately slow connections or
787
+ // busy servers to read it.
788
+ defaultReadHeaderTimeout = caddy .Duration (time .Minute )
789
+ )
778
790
779
791
// Interface guards
780
792
var (
0 commit comments