* add initializer on Faraday::Adapter that accept and store a block with custom configuration
use the `@ config_block ` block on `net_http` and `net_http_persistent` adapters
added tests
* fixes warning in tests
patron was supporting custom block already! Small refactoring to conform to other adapters
* added implementation for httpclient
excon and EM adapters now all support `connection_options` in the initializer
* additional test for httpclient adapter
* Adds a `#reason_phrase` method to the Response class
Implements the reason phrase for the Net::Http adapter ONLY
* Reason phrase support for the Excon adapter
This assumes that the reason phrase is also implemented into the
Excon project
* Implement reason phrase for patron, httpclient, em_http, em_synchrony adapters.
* Don't test for reason phrase with Rack adapter, which doesn't make it available.
* Don't test for reason phrase support in Typhoeus adapter.
* Make reason_phrase nil in adapters that don't support it (instead of "")
When Addressable::URI is used, the `port` property will be nil unless
port was explicitly specified. This made Addressable unusable in HTTPS
scenarios with Net::HTTP adapters, which would default to port 80 even
when the scheme was "https".
In Ruby 1.9, zlib is required by net/http but this is not the case in
Ruby 1.8, causing a NameError (uninitialized constant
Faraday::Adapter::NetHttp::Zlib).
Zero-byte response bodies can be represented as either nil or '' in ruby.
Most ruby HTTP clients use '' (which, conveniently, allows clients
to assume the body is always a string), but Net::HTTP, for whatever
reason, uses nil.
This change makes it so that all faraday adapters consistently return
'' for zero-byte response bodies.
ssl_verify_mode was referencing http, which resulted in:
NameError: undefined local variable or method `http' for #<Faraday::Adapter::NetHttp:0x007fe8c2cc24e8>
This is a potentially breaking change for 3rd party code that relies on
env[:url] being specifically Addressable. After this change all urls are
passed around as instances of URI::HTTP.
Previous logic correction (70f3eb3) was in fact a breakage of functionality.
The ssl[:verify_mode] is not a boolean; it's the value that, if present,
should be passed directly to http.verify_mode