Skip to content

Commit

Permalink
Add support for gzip decompressing in Ruby gem
Browse files Browse the repository at this point in the history
This commit sets the middleware used by Excon connections to include the
defaults and Excon::Middleware::Decompress, which decompresses gzip data
returned from the Mailchimp API.
  • Loading branch information
dhughes committed Mar 26, 2023
1 parent f6bc606 commit b6111df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion swagger-config/marketing/ruby/templates/api_client.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ module {{moduleName}}
headers[:Authorization] = "Bearer #@access_token" if @is_oauth

host = @server.length > 0 ? @host.sub('server', @server) : @host
conn = Excon.new(host + path, :headers => headers, :read_timeout => @read_timeout, :write_timeout => @write_timeout, :connect_timeout => @connect_timeout)
conn = Excon.new(host + path,
:headers => headers,
:read_timeout => @read_timeout,
:write_timeout => @write_timeout,
:connect_timeout => @connect_timeout,
:middlewares => [Excon.defaults[:middlewares], Excon::Middleware::Decompress].flatten)

res = nil
case http_method.to_sym.downcase
Expand Down

0 comments on commit b6111df

Please sign in to comment.