Permalink
Browse files

Removed gzip decoding from Flickr client as that API doesn't support …

…a gzip compressed response
  • Loading branch information...
1 parent cc6b552 commit a5cbc8a682ca97d8a2538c18ab9b549aafaa7614 @pietern pietern committed Oct 3, 2008
Showing with 2 additions and 13 deletions.
  1. +2 −13 lib/contacts/flickr.rb
View
@@ -1,8 +1,6 @@
contacts_path = File.expand_path(File.join(File.dirname(__FILE__), '..'))
$:.unshift(contacts_path) unless $:.include?(contacts_path)
require 'contacts'
-require 'zlib'
-require 'stringio'
module Contacts
@@ -115,22 +113,13 @@ def self.http_start(ssl = false)
http.finish
end
end
-
- def self.response_body(response)
- unless response['Content-Encoding'] == 'gzip'
- response.body
- else
- gzipped = StringIO.new(response.body)
- Zlib::GzipReader.new(gzipped).read
- end
- end
-
+
def self.inspect_response(response, out = $stderr)
out.puts response.inspect
for name, value in response
out.puts "#{name}: #{value}"
end
- out.puts "----\n#{response_body response}\n----" unless response.body.empty?
+ out.puts "----\n#{response.body}\n----" unless response.body.empty?
end
end

0 comments on commit a5cbc8a

Please sign in to comment.