picasa
picasa copied to clipboard
Google responds with incorrect encoding if a User-Agent containing "gzip" is used
I did not investigate this very deeply, but currently, the library fails with the following trace, unless the User-Agent header is changed by removing the " gzip" from it like so:
# Google responds with incorrect encoding if a User-Agent containing "gzip" is used
# BAD: ruby-gem-picasa-v0.9.1 (gzip)
# BAD: gzip
# GOOD: foo (blah)
# GOOD: ruby-gem-picasa-v0.9.1
# GOOD: foo
# GOOD: <none>
Picasa::HTTP.instance_variable_get(:@default_options)[:headers]['User-Agent'].sub!(/ \(gzip\)/, '')
Please remove (gzip)
from lib/picasa/http.rb
.
/usr/lib/ruby/2.0.0/json/common.rb:155:in `parse': 795: unexpected token at '' (JSON::ParserError)
from /usr/lib/ruby/2.0.0/json/common.rb:155:in `parse'
from /var/lib/gems/2.0.0/gems/httparty-0.15.6/lib/httparty/parser.rb:123:in `json'
from /var/lib/gems/2.0.0/gems/httparty-0.15.6/lib/httparty/parser.rb:143:in `parse_supported_format'
from /var/lib/gems/2.0.0/gems/httparty-0.15.6/lib/httparty/parser.rb:108:in `parse'
from /var/lib/gems/2.0.0/gems/httparty-0.15.6/lib/httparty/parser.rb:67:in `call'
from /var/lib/gems/2.0.0/gems/httparty-0.15.6/lib/httparty/request.rb:382:in `parse_response'
from /var/lib/gems/2.0.0/gems/httparty-0.15.6/lib/httparty/request.rb:350:in `block in handle_response'
from /var/lib/gems/2.0.0/gems/httparty-0.15.6/lib/httparty/response.rb:25:in `call'
from /var/lib/gems/2.0.0/gems/httparty-0.15.6/lib/httparty/response.rb:25:in `parsed_response'
from /var/lib/gems/2.0.0/gems/picasa-0.9.1/lib/picasa/api/album.rb:19:in `list'