If I send a request without a Host header attached, the whole server crashes.
var hostParts = host.split(":", 2);
^
TypeError: Cannot read property 'split' of undefined
at createLocation (node_modules/mach/lib/utils/createConnection.js:47:23)
It looks like I'm behind a proxy that probes the host with host-less requests before sending the actual request.
I don't know HTTP well enough to know what the behavior should be if Host is unspecified. Maybe it should serve from the default hostname or maybe it should respond with a blank page and/or error code, but it certainly shouldn't crash the server.
Here's the test I used to see what the client was sending:
var http = require("http");
var server = http.createServer(
function (req, res) {
console.log(JSON.stringify(req.headers));
res.end();
}
);
server.listen(8080);
If I send a request without a Host header attached, the whole server crashes.
It looks like I'm behind a proxy that probes the host with host-less requests before sending the actual request.
I don't know HTTP well enough to know what the behavior should be if
Host
is unspecified. Maybe it should serve from the default hostname or maybe it should respond with a blank page and/or error code, but it certainly shouldn't crash the server.Here's the test I used to see what the client was sending:
and the result: