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-1.2.10 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.9 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.14 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.8 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.7 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.6 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.5 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.4 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.3 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.2.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.1.3 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.1.2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.1.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.1.0 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.0.7 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.0.6 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.0.5 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.0.4 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.0.3 lib/zendesk_api/middleware/response/deflate.rb