tmm1/http_parser.rb — Issue #13: Should parse PATCH method and HTTP/0.9
Author: lgierth
Created: 2012-01-26 02:19:58+00:00
State: open

Given the following code I get a Parser::Error, same with `GET / HTTP/0.9`.

```ruby
req = ""
req << "PATCH / HTTP/1.1\r\n"
req << "Host: 127.0.0.1:4567\r\n"
req << "Transfer-Encoding: chunked\r\n"
req << "\r\n"
req << "9\r\n"
req << "name=zack\r\n"
req << "0\r\n"
req << "\r\n"

require "http/parser"

parser = HTTP::Parser.new
parser.on_headers_complete = proc do
p parser.http_method
p parser.request_url
p parser.headers
end
parser.on_body = proc do |chunk|
p chunk
end
parser.on_message_complete = proc do
puts "finished!"
end

parser << req
```