lib/async/http/accept_encoding.rb in async-http-0.37.0 vs lib/async/http/accept_encoding.rb in async-http-0.37.1
- old
+ new
@@ -45,12 +45,10 @@
def call(request)
request.headers[ACCEPT_ENCODING] = @accept_encoding
response = super
- if !response.body.empty? and content_encoding = response.headers.delete(CONTENT_ENCODING)
- body = response.body
-
+ if body = response.body and !body.empty? and content_encoding = response.headers.delete(CONTENT_ENCODING)
# We want to unwrap all encodings
content_encoding.reverse_each do |name|
if wrapper = @wrappers[name]
body = wrapper.call(body)
end