Sha256: 7e95f0d3f53205898bac566857b8c7c3eaf56002d51e8a77dded5f0044c84fcc
Contents?: true
Size: 670 Bytes
Versions: 12
Compression:
Stored size: 670 Bytes
Contents
# Monkey patch to handle the case where Content-Type headers returned by servers # say "gzip" by the resulting message body isn't in gzip format. # TODO Remove this when we upgrade Berkshelf and the gzip response goes away. # https://github.com/berkshelf/berkshelf-api-client/blob/v1.3.0/lib/berkshelf/api_client/connection.rb#L37 require 'faraday_middleware' module FaradayMiddleware class Gzip alias_method :__uncompress_gzip__, :uncompress_gzip def uncompress_gzip(body) __uncompress_gzip__(body) rescue Zlib::GzipFile::Error StringIO.new(body).read end end end Faraday::Response.register_middleware :gzip => FaradayMiddleware::Gzip
Version data entries
12 entries across 12 versions & 1 rubygems