This is a bit of an lousy bug report, more of an notion. I had the http-proxy module fail with the following error message:
var target = proxy.req.headers.host.split(':') + proxy.req.url;
TypeError: Cannot call method 'split' of undefined
at [object Object].proxyRequest (/root/local/node/lib/node/.npm/http-proxy/0.3.1/package/lib/proxy-table.js:80:39)
at Server.<anonymous> (/root/local/node/lib/node/.npm/http-proxy/0.3.1/package/lib/node-http-proxy.js:93:18)
at Server.emit (events.js:45:17)
at HTTPParser.onIncoming (http.js:1078:12)
at HTTPParser.onHeadersComplete (http.js:87:31)
at Socket.ondata (http.js:977:22)
at Socket._onReadable (net.js:654:27)
at IOWatcher.onReadable [as callback] (net.js:156:10)
Was not able to identify what caused it.... trying reproduce. Any idea?
Hmm ... definitely an edge case but something I should be checking for to prevent crashed from malformed requests. Here's the scenario
I'll put in a check in 0.4.0. Going to get pushed out in the next 10 days or so
I tried to telnet and do a request by hand without the Host header. Does not crash the server =)
hmm ... odd. Well no host header is the only reason I can think of that req.headers.host would be undefined.