Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Google responds with incorrect encoding if a User-Agent containing "gzip" is used #41

Open
dtreskunov opened this issue Oct 22, 2017 · 0 comments

Comments

@dtreskunov
Copy link

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'
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant