igrigorik/em-http-request — Issue #163: Header parsing: can't convert Array to String
Author: rb2k
Created: 2012-01-04 23:49:18+00:00
State: open

Yet another one of those "I found this in my logs" errors without much more detail :(
This one seems to be about a bad handling of strangely formed headers.

Error raised during event loop: can't convert Array to String:

["/usr/local/rvm/gems/ruby-1.9.3-p0/gems/em-http-request-1.0.0/lib/em-http/client.rb:269:in `match'", "/usr/local/rvm/gems/ruby 1.9.3-p0/gems/em-http-request-1.0.0/lib/em-http/client.rb:269:in `parse_response_header'", "/usr/local/rvm/gems/ruby-1.9.3-p0/gems/em-http-request-1.0.0/lib/em-http/http_connection.rb:108:in `block in post_init'", "/usr/local/rvm/gems/ruby-1.9.3-p0/gems/em-http-request-1.0.0/lib/em-http/http_connection.rb:134:in `call'", "/usr/local/rvm/gems/ruby-1.9.3-p0/gems/em-http-request-1.0.0/lib/em-http/http_connection.rb:134:in `<<'", "/usr/local/rvm/gems/ruby-1.9.3-p0/gems/em-http-request-1.0.0/lib/em-http/http_connection.rb:134:in `receive_data'", "/usr/local/rvm/gems/ruby-1.9.3-p0/gems/em-http-request-1.0.0/lib/em-http/http_connection.rb:21:in `receive_data'", "/usr/local/rvm/gems/ruby-1.9.3-p0/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'", "/usr/local/rvm/gems/ruby-1.9.3-p0/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'",

Since there is only one "match" call in the file that should be it:

/;\s*charset=\s*(.+?)\s*(;|$)/.match(content_type)

This has been changed on [September 9th](https://github.com/igrigorik/em-http-request/commit/20a407ef3d90eb8db2ab4a0a19fd120ecc9d0e4e). Since the current stable is from August 27, my guess would be that I should run on the git master branch to get rid of this?