Rack version >=1.4.1 add BodyProxy to do thread lock, which need sham_rack to close the BodyProxy manually. I modified the net_http.rb file to fix the problem.
Fu Ying: add body.close as the rack version > 1.4.1 add BodyProxy
Hi Fu Ying. Thanks for the pull request.
I would like a test, though, that demonstrates the bug under newer versions of Rack. Is it easy to reproduce?
FWIW, I've now got sham_rack's tests running against multiple versions of the rack gem, on Travis CI. See: https://travis-ci.org/mdub/sham_rack
Also, I'm not comfortable with your Gemfile change, as I would like sham_rack to continue to be usable with older versions of rack. I suspect there's some way we can avoid requiring the new "Rack::BodyProxy" class, perhaps by using a respond_to? check, rather than instance_of?.
Hi Mike. Very glad to see your reply.
The error we meet is come from the lock mechanism of new version rack. I haven't find the simple way to reproduce it. In our system, we use cucumber, httparty to call method in sham_rack. There are two request are sent out continuous, the first one will lock the thread which will make the second got an error about thread.
I will keep trying to reproduce it when I have time.