lib/grover/middleware.rb in grover-0.9.2 vs lib/grover/middleware.rb in grover-0.10.1
- old
+ new
@@ -16,10 +16,14 @@
@png_request = false
@jpeg_request = false
end
def call(env)
+ dup._call(env)
+ end
+
+ def _call(env)
@request = Rack::Request.new(env)
identify_request_type
configure_env_for_grover_request(env) if grover_request?
status, headers, response = @app.call(env)
@@ -63,9 +67,10 @@
headers['Content-Type'] =~ %r{text/html|application/xhtml\+xml}
end
def update_response(response, headers)
body, content_type = convert_response response
+ response.close if response.respond_to? :close
assign_headers headers, body, content_type
[body]
end
def convert_response(response)