mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-13 17:26:46 +00:00
caddyhttp: Limit empty Host check to HTTP/1.1
This commit is contained in:
parent
72eaf2583a
commit
eac02ee98f
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue