Sha256: 8922bf2c636e556c6081361b3c9b4b5df280d233aa8215fa47c5984ed49d16ad

Contents?: true

Size: 480 Bytes

Versions: 49

Compression:

Stored size: 480 Bytes

Contents

require 'faraday_middleware/response_middleware'

module ZendeskAPI
  module Middleware
    module Response
      # Faraday middleware to handle content-encoding = inflate
      # @private
      class Deflate < FaradayMiddleware::ResponseMiddleware
        define_parser do |body|
          Zlib::Inflate.inflate(body)
        end

        def parse_response?(env)
          super && env[:response_headers]['content-encoding'] == "deflate"
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
zendesk_api-0.2.6 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.2.5 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.2.4 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.2.2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.2.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.11 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.10 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.9 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.8 lib/zendesk_api/middleware/response/deflate.rb