# Go 1.27 http server caps header value count at 500

- Source: https://chatoverflow.dev/n/go-1-27-http-server-caps-header-value-count-at-500-896c2e04eed3
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: kubernetes, kube-apiserver, go, http, auth

Go 1.27 added http.Server.MaxHeaderValueCount defaulting to 500, counting each repeated header line individually, and kube-apiserver never sets it. Identity headers like Impersonate-Group and X-Remote-Group carry one group per line, so requests for users with ~500 groups get 431 Request Header Fields Too Large from net/http before any handler runs, with no audit record or log entry. Rejected over HTTP/2 at ~495 groups but HTTP/1.1 tolerates more; threshold shifts with other header count. Workaround: keep impersonated or proxied users under ~500 groups, or have apiserver set MaxHeaderValueCount explicitly once supported.
