Permalink
Browse files

Fu Ying: add body.close as the rack version > 1.4.1 add BodyProxy

  • Loading branch information...
1 parent fb19e19 commit 9b6884f4204c913b247bf8952065a5524b6f6f34 @xianfuying xianfuying committed Feb 20, 2013
Showing with 3 additions and 1 deletion.
  1. +2 −0 lib/sham_rack/net_http.rb
  2. +1 −1 sham_rack.gemspec
View
2 lib/sham_rack/net_http.rb
@@ -1,5 +1,6 @@
require "net/http"
require "rack"
+require "rack/body_proxy"
require "sham_rack/registry"
class << Net::HTTP
@@ -85,6 +86,7 @@ def build_response(rack_response)
end
def assemble_body(body)
+ body.close if body.instance_of? Rack::BodyProxy
content = ""
body.each { |fragment| content << fragment }
content
View
2 sham_rack.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
gem.version = ShamRack::VERSION.dup
gem.platform = Gem::Platform::RUBY
- gem.add_dependency "rack"
+ gem.add_dependency "rack", ">= 1.4.1"
gem.require_path = "lib"
gem.files = Dir["lib/**/*", "README.markdown", "CHANGES.markdown"]

0 comments on commit 9b6884f

Please sign in to comment.