mirror of
https://github.com/caddyserver/caddy.git
synced 2026-03-04 16:15:19 -05:00
caddyhttp: Limit empty Host check to HTTP/1.1
This commit is contained in:
parent
72eaf2583a
commit
eac02ee98f
@ -486,7 +486,7 @@ func (s *Server) serveHTTP(w http.ResponseWriter, r *http.Request) error {
|
||||
// code to any HTTP/1.1 request message that lacks a Host header field and to any
|
||||
// request message that contains more than one Host header field line or a Host
|
||||
// header field with an invalid field value."
|
||||
if r.Host == "" {
|
||||
if r.ProtoMajor == 1 && r.ProtoMinor == 1 && r.Host == "" {
|
||||
return HandlerError{
|
||||
Err: errors.New("rfc9112 forbids empty Host"),
|
||||
StatusCode: http.StatusBadRequest,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user