Sha256: 95005af4579e23475d77b6de81b93f3cd4c4e441afcbe54e45adede30437319a

Contents?: true

Size: 463 Bytes

Versions: 8

Compression:

Stored size: 463 Bytes

Contents

require 'faraday_middleware/response_middleware'

module ZendeskAPI
  module Middleware
    module Response
      # Faraday middleware to handle content-encoding = inflate
      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

8 entries across 8 versions & 1 rubygems

Version Path
zendesk_api-0.1.7 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.6 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.5 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.4 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.3 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.2 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.1.1 lib/zendesk_api/middleware/response/deflate.rb
zendesk_api-0.0.9 lib/zendesk_api/middleware/response/deflate.rb