Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Crash on request with bad headers? #25

muhmi opened this Issue · 3 comments

2 participants



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 =':')[0] + 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

  1. You're using the ProxyTable.
  2. You're proxying by Host (i.e. proxy based on the value of the HTTP "Host" header
  3. Some careless user decided not to include a Host header
  4. Crash because (i.e. the value of the HTTP Host header) is undefined

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 would be undefined.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.