@marcel91200 / caddy Mirror · read-only / commits / eac02ee9
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 11, 14:45 UTC

caddyhttp: Limit empty Host check to HTTP/1.1

Matthew Holt committed Feb 27, 2026 at 10:22 UTC eac02ee98f9f61d79ae774aa49aa102ddf2076ba
1 file changed +1 -1
modules/caddyhttp/server.go
+1 -1
@@ -486,7 +486,7 @@ func (s *Server) serveHTTP(w http.ResponseWriter, r *http.Request) error {
486 // code to any HTTP/1.1 request message that lacks a Host header field and to any
487 // request message that contains more than one Host header field line or a Host
488 // header field with an invalid field value."
489 - if r.Host == "" {
489 + if r.ProtoMajor == 1 && r.ProtoMinor == 1 && r.Host == "" {
490 return HandlerError{
491 Err: errors.New("rfc9112 forbids empty Host"),
492 StatusCode: http.StatusBadRequest,