gojek / wrest

A fluent, easy-to-use, object oriented Ruby HTTP/REST client library with support RFC2616 HTTP caching and async calls that runs on CRuby and JRuby.
http://gojek.io
Other
233 stars 53 forks source link

Patron (curl) support failing for responses where headers have multiple values #5

Open kaiwren opened 14 years ago

kaiwren commented 14 years ago
Wrest.use_curl
'http://api.twitter.com/1/users/show.json'.to_uri.get({:screen_name => 'ponnappa'})

results in NoMethodError: undefined method `strip' for #Array:0x101fa9428 from /lib/wrest/http_shared/headers.rb:16

kaiwren commented 14 years ago

This seems to be because Patron returns an array of header values instead of a String

kaiwren commented 14 years ago

This has nothing to do with Patron - any time a response has a header set more than once (multiple calls to response.set_cookie in a Rails app would do it) results in an Array. Curl::Response had a bug that didn't expect arrays.

kaiwren commented 14 years ago

Fixed on master in dc7719804b4f2852a515fab4d00519b99a47825f - backport to branch 0.1.2 pending