tmm1 / http_parser.rb

simple callback-based HTTP request/response parser
MIT License
200 stars 43 forks source link

Can't parse CONNECT www.google.de: HTTP/1.0 #44

Open jan opened 9 years ago

jan commented 9 years ago

A client sends this request:

CONNECT www.google.de: HTTP/1.0
Proxy-Authorization: Basic FAKEX2tleTphcGlfa2V5X3Rlc3RfdXNlcg==

Notice the colon after www.google.de:. It works if there is a port number after the colon www.google.de:443.

The message is Could not parse data entirely (22 != 100) and the colon is the 22nd char.

I realise that the message above is probably malformed, but I'm not sure about that as I didn't find the relevant RFC yet. Still as we try to be robust in what data we accept, I could see this being accepted by http_parser.rb. What do you think?