summary refs log tree commit
path: root/lib/rack/deflater.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rack/deflater.rb')
-rw-r--r--lib/rack/deflater.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rack/deflater.rb b/lib/rack/deflater.rb
index 8e18e160..3f6177e6 100644
--- a/lib/rack/deflater.rb
+++ b/lib/rack/deflater.rb
@@ -44,10 +44,10 @@ module Rack
     end
 
     def call(env)
-      status, headers, body = @app.call(env)
+      status, headers, body = response = @app.call(env)
 
       unless should_deflate?(env, status, headers, body)
-        return [status, headers, body]
+        return response
       end
 
       request = Request.new(env)
@@ -67,9 +67,10 @@ module Rack
         headers.delete(CONTENT_LENGTH)
         mtime = headers["last-modified"]
         mtime = Time.httpdate(mtime).to_i if mtime
-        [status, headers, GzipStream.new(body, mtime, @sync)]
+        response[2] = GzipStream.new(body, mtime, @sync)
+        response
       when "identity"
-        [status, headers, body]
+        response
       else # when nil
         # Only possible encoding values here are 'gzip', 'identity', and nil
         message = "An acceptable encoding for the requested resource #{request.fullpath} could not be found."