called start_with_request without a block, because as Net:HTTP's start method description says, it will open AND close a connection if start is called with a block. In this case Net:HTTP then later tries to close that same connection again if the server's response has "Connection: close" in its header. In that case Net:HTTP will throw an IOError.
Clone the URI before mutating it.

The #build_request_signature method was mutating the URI if there were
any @req.query options. This means that if the request does actually get
sent, em-http-request appends the query to the URI a second time, and
the parameters are repeated.

For example:

EventMachine::HttpRequest.new('http://example.com/').get(:query => { :a => '1' })

would result in the follow URI being used for a live request:

http://example.com/?a=1&a=1
Merge pull request #184 from jonleighton/dont_mutate_uri

Clone the URI before mutating it.
Fix typhoeus 0.4.0 issues.
Fix Net::HTTP adapter so that it returns `nil` for an empty body response.

This mirrors the real behavior of Net::HTTP and is the source of myronmarston/vcr#173.

A couple things to note:

- Rather than hitting an external URL (httpstat.us/204), this should probably
  hit the local webmock server; however, I can't figure out how to make the
  webmock server return a different response for different requests since it's
  writing directly to the socket w/o any request context available. Maybe it
  should be refactored to use rack or sinatra?
- I have no idea why, but Curb is returning a 400 Bad Request response for
  the request. Weird. Not sure why or how to fix it.
Fixing travis-ci image to report master's status
Fix EventMachine::HttpRequest on proxy method.

Caused by
https://github.com/igrigorik/em-http-request/commit/7d5752d1bcf90b749c3be6eb384e7bdf81441be0

Signed-off-by: chatgris <jboyer@af83.com>
request_pattern should handle content_types that specify a charset
Fix em-http-request callback triggering

Previously, if there were other EM::Deferred callbacks registered, they
might execute before WebMock's callback and raise an exception. This
would prevent the WebMock callback ever running, even though there was a
successful request.

Overriding set_deferred_status prevents this by triggering WebMock's
callbacks before running any of the EM::Deferred callbacks.

Sorry, I have no idea how to test this.
Merge pull request #196 from jonleighton/fix_em_http_callbacks

Fix em-http-request callback triggering
Merge pull request #191 from ryansch/fix-travis-image

Fixing travis-ci image to report master's status
Merge pull request #192 from chatgris/em-http-proxy

Fix EventMachine::HttpRequest on proxy method.
Merge pull request #194 from kjg/request_pattern_charset

request_pattern should handle content_types that specify a charset
Merge pull request #178 from HendrikW/master

Net:HTTP adapter tries to close connection two times and throws error
Merge pull request #189 from i0rek/typhoeus

Fix typhoeus 0.4.0 issues.
Revert "Merge pull request #178 from HendrikW/master"

This reverts commit 36aff464f7f4a95dd82a17c6954bc1160a6e83a1, reversing
changes made to 1e61a8cea970a45b35431fdaaa94ed016f945457.
Em-http-request now throws RuntimeError on connection refused.
Webmock is not compatible with Addressable >= 2.3.0 yet
Merge pull request #190 from bblimke/nil_response_body

Fix Net::HTTP adapter so that it returns `nil` for an empty body response.
Acceptance spec incompatible with Curb doesn't run in Curb specs.