history.md
:log option to individual requests. This allows users to set a log on a
per-request / per-resource basis instead of the kludgy global log. (#538)log_response a method on the Response object, and ensure the size method
works on RawResponse objects. (#126)
# => 200 OK | text/html 1270 bytes, 0.08s:stream_log_percent parameter, which is applicable only
when :raw_response => true is set. This causes progress logs to be
emitted only on every N% (default 10%) of the total download size rather
than on every chunk.Accept-Encoding header, rely instead on Net::HTTP defaults. (#597)
:raw_response => true. Previously the raw response would not have been
uncompressed by rest-client, but now Net::HTTP will uncompress it.Payload.generate would wrap a
Payload object in Payload::Streamed, creating a pointlessly nested payload.
Also add a closed? method to Payload objects, and don't error in
short_inspect if size returns nil. (#603)This release is largely API compatible, but makes several breaking changes.
Content-Type: text/plain; charset=EUC-JP will return a String
encoded with Encoding::EUC_JP. (#361)RestClient::RequestTimeout (which is still used for HTTP 408), network
timeouts will now raise either RestClient::Exceptions::ReadTimeout or
RestClient::Exceptions::OpenTimeout, both of which inherit from
RestClient::Exceptions::Timeout. For backwards compatibility, this still
inherits from RestClient::RequestTimeout so existing uses will still work.
This may change in a future major release. These new timeout classes also
make the original wrapped exception available as #original_exception.RestClient::RequestFailed, which still
inherits from ExceptionWithResponse. Previously, HTTP 304, 401, and 404
inherited directly from ExceptionWithResponse rather than from
RequestFailed. Now all HTTP status code exceptions inherit from both.:timeout request option to :read_timeout. When :timeout is
passed, now set both :read_timeout and :open_timeout.*/*Response objects are now a subclass of String rather than a String that
mixes in the response functionality. Most of the methods remain unchanged,
but this makes it much easier to understand what is happening when you look
at a RestClient response object. There are a few additional changes:
.inspect to make this distinction clearer.Response#to_i will now behave like String#to_i instead of returning the
HTTP response code, which was very surprising behavior.Response#body and #to_s will now return a true String object rather
than self. Previously there was no easy way to get the true String
response instead of the Frankenstein response string object with
AbstractResponse mixed in.:cookies option may now be a Hash of Strings, an Array of
HTTP::Cookie objects, or a full HTTP::CookieJar.RestClient::Request#cookie_jar and reimplement Request#cookies to
be a wrapper around the cookie jar.:cookies option in the headers hash, but now
raise ArgumentError if that option is also passed to Request#initialize.:cookies and a Cookie header are supplied.Request#cookie_jar as the basis for Response#cookie_jar,
creating a copy of the jar and adding any newly received cookies.Authorization header is specified:proxy option to requests, which can be used for thread-safe
per-request proxy configuration, overriding RestClient.proxyENV['http_proxy'] to disable proxies by setting
RestClient.proxy to a falsey value. Previously there was no way in Ruby 2.x
to turn off a proxy specified in the environment without changing ENV..to_s even on RestClient::Payload::Streamed objects. Instead,
treat any object that responds to .read as a streaming payload and pass it
through to .body_stream= on the Net:HTTP object. This massively reduces the
memory required for large file uploads.RestClient::MaxRedirectsReached in favor of the normal
ExceptionWithResponse subclasses. This makes the response accessible on
the exception object as .response, making it possible for callers to tell
what has actually happened when the redirect limit is reached..history. This makes it possible to access the
original response headers and body before the redirection was followed.:before_execution_proc option to RestClient::Request. This makes it
possible to add procs like RestClient.add_before_execution_proc to a single
request without global state.Request#transmit a private method, along with a few others.RestClient::Payload::Base#inspect stop pretending to be a String.Request#redacted_uri and Request#redacted_url to display the URI
with any password redacted.Changes in the release candidate that did not persist through the final 2.0.0 release:
Security: implement standards compliant cookie handling by adding a dependency on http-cookie. This breaks compatibility, but was necessary to address a session fixation / cookie disclosure vulnerability. (#369 / CVE-2015-1820)
Previously, any Set-Cookie headers found in an HTTP 30x response would be sent to the redirection target, regardless of domain. Responses now expose a cookie jar and respect standards compliant domain / path flags in Set-Cookie headers.
type_for_extension method, use
the public interface instead.VERIFY_PEER with OpenSSL)ca_pathcert_storeverify_callback (with some caveats for jruby, OS X, #277)ssl_verify_callback functionality from 1.7.0The response change may be breaking in rare cases.
The only breaking change should be the exception classes, but as the new classes inherits from the existing ones, the breaking cases should be rare.
All changes exept the last one should be fully compatible with the previous version.
NOTE: due to a dependency problem and to the last change, heroku users should update their heroku gem to >= 1.5.3 to be able to use this version.