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.0.2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.0.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.0.0 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.13 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.12 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.4.0.rc3 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.4.0.rc2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.11 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.10 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.9 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.8 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.4.0.rc1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.7 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.6 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.5 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.4 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.3 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.3.0 lib/zendesk_api/middleware/response/deflate.rb