Host Header
Host Header
The Host header is the only header where RFC 9112 explicitly mandates a 400 response for violations. This makes the Host header tests the strictest in the entire suite — close or timeout is NOT acceptable.
The Rule
“A server MUST respond with a 400 (Bad Request) status 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.” — RFC 9112 Section 3.2
This single sentence covers three violations:
- Missing Host header
- More than one Host header line (duplicate)
- Host header with an invalid field value