lib/pupa/processor/client.rb in pupa-0.0.12 vs lib/pupa/processor/client.rb in pupa-0.0.13
- old
+ new
@@ -1,13 +1,15 @@
require 'active_support/cache'
require 'faraday_middleware'
require 'faraday_middleware/response_middleware'
+require 'pupa/processor/middleware/gzip'
require 'pupa/processor/middleware/logger'
require 'pupa/processor/middleware/parse_html'
require 'pupa/processor/middleware/parse_json'
require 'pupa/processor/middleware/raise_error'
+require 'pupa/refinements/faraday'
require 'pupa/refinements/faraday_middleware'
begin
require 'multi_xml'
rescue LoadError
@@ -46,9 +48,12 @@
# @see http://tools.ietf.org/html/rfc3023
if defined?(MultiXml)
connection.use FaradayMiddleware::ParseXml, preserve_raw: true, content_type: /\bxml$/
end
+
+ # Must come after the parser middlewares.
+ connection.use Middleware::Gzip
if cache_dir
connection.response :caching do
address = cache_dir[%r{\Amemcached://(.+)\z}, 1]
if address