-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Closed
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.securityIssues and PRs related to security.Issues and PRs related to security.
Description
Per RFC 7230: "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 or a Host header field with an invalid field-value."
Node currently ignores this requirement. To test, create a simple server:
http.createServer(function(req,res) {
res.end('ok');
}).listen(8080);First, test the missing Host header
$ telnet localhost 8080
GET / HTTP/1.1
HTTP/1.1 200 OKSecond, test duplicate Host headers:
$ telnet localhost 8080
GET / HTTP/1.1
Host: A
Host: B
HTTP/1.1 200 OKThird, test malformed Host headers:
$ telnet localhost 8080
GET / HTTP/1.1
Host: A, B
HTTP/1.1 200 OKsteebchen
Metadata
Metadata
Assignees
Labels
httpIssues or PRs related to the http subsystem.Issues or PRs related to the http subsystem.securityIssues and PRs related to security.Issues and PRs related to security.