Sha256: 3c0674bcd45a829140ad2ffeb1d3e318e9962b03c9fd2d9422f80706b732791e
Contents?: true
Size: 516 Bytes
Versions: 12
Compression:
Stored size: 516 Bytes
Contents
require 'zlib' require 'stringio' module ZendeskAPI # @private module Middleware # @private module Response # Faraday middleware to handle content-encoding = gzip class Gzip < Faraday::Middleware def on_complete(env) return if env[:response_headers]['content-encoding'] != "gzip" return if env[:body].force_encoding(Encoding::BINARY).strip.empty? env[:body] = Zlib::GzipReader.new(StringIO.new(env[:body])).read end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems