Sha256: 0aca682f870d2f260704cb63523b887f542a28c9b24cac7e68a704a6a4e98c72

Contents?: true

Size: 450 Bytes

Versions: 12

Compression:

Stored size: 450 Bytes

Contents

module ZendeskAPI
  # @private
  module Middleware
    # @private
    module Response
      # Faraday middleware to handle content-encoding = inflate
      # @private
      class Deflate < Faraday::Middleware
        def on_complete(env)
          return if env[:response_headers]['content-encoding'] != "deflate"
          return if env.body.strip.empty?

          env.body = Zlib::Inflate.inflate(env.body)
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
zendesk_api-3.1.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-3.1.0 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-3.0.5 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-3.0.4 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-3.0.2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-3.0.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-3.0.0 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-3.0.0.rc1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-2.0.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-2.0.0 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.38.0.rc2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-1.38.0.rc1 lib/zendesk_api/middleware/response/deflate.rb