Skip to content

Latest commit

 

History

History
782 lines (524 loc) · 21.8 KB

CHANGES.md

File metadata and controls

782 lines (524 loc) · 21.8 KB

4.2.0 (WIP)

4.1.1 (2019-03-12)

  • Add HTTP::Headers::ACCEPT_ENCODING constant. (@ixti)

4.1.0 (2019-03-11)

  • #533 Add URI normalizer feature that allows to swap default URI normalizer. (@mamoonraja)

4.0.5 (2019-02-15)

  • Backport #532 from master. Fix pipes support in request bodies. (@ixti)

4.0.4 (2019-02-12)

  • Backport #506 from master. Skip auto-deflate when there is no body. (@Bonias)

4.0.3 (2019-01-18)

  • Fix missing URL in response wrapped by auto inflate. (@ixti)

  • Provide HTTP::Request#inspect method for debugging purposes. (@ixti)

4.0.2 (2019-01-15)

4.0.1 (2019-01-14)

  • #515 Fix #build_request and #request to respect default options. (@RickCSong)

4.0.0 (2018-10-15)

  • #482 #499 Introduce new features injection API with 2 new feaures: instrumentation (compatible with ActiveSupport::Notification) and logging. (@paul)

  • #473 Handle early responses. (@janko-m)

  • #468 Rewind HTTP::Request::Body#source once #each is complete. (@ixti)

  • #467 Drop Ruby 2.2 support. (@ixti)

  • #436 Raise ConnectionError when writing to socket fails. (@janko-m)

  • #438 Expose HTTP::Request::Body#source. (@janko-m)

  • #446 Simplify setting a timeout. (@mikegee)

  • #451 Reduce memory usage when reading response body. (@janko-m)

  • #458 Extract HTTP::Client#build_request method. (@tycoon)

  • #462 Fix HTTP::Request#headline to allow two leading slashes in path. (@scarfacedeb)

  • #454 #464 #384 Fix #readpartial not respecting max length argument. (@janko-m, @marshall-lee)

3.3.0 (2018-04-25)

This version backports some of the fixes and improvements made to development version of the HTTP gem:

  • #458 Extract HTTP::Client#build_request method. (@tycoon)

3.2.1 (2018-04-24)

  • #468 Rewind HTTP::Request::Body#source once #each is complete. (@ixti)

3.2.0 (2018-04-22)

This version backports one change we missed to backport in previous release:

  • Reduce memory usage when reading response body (@janko-m)

3.1.0 (2018-04-22)

This version backports some of the fixes and improvements made to development version of the HTTP gem:

  • Fix for #readpartial to respect max length argument. (@janko-m, @marshall-lee)

  • Fix for HTTP::Request#headline to allow two leading slashes in path. (@scarfacedeb)

  • Fix query string building for string with newlines. (@mikegee)

  • Deallocate temporary strings in Response::Body#to_s. (@janko-m)

  • Add Request::Body#source. (@janko-m)

3.0.0 (2017-10-01)

2.2.2 (2017-04-27)

  • #404, #405 Make keepalive timeout configurable. ([@nestegg])

2.2.1 (2017-02-06)

  • #395 Fix regression of API, that broke webmock integration. (@ixti)

2.2.0 (2017-02-03)

  • #375 Add support for automatic Gzip/Inflate (@Bonias)

  • #390 Add REPORT to the list of valid HTTP verbs (@ixti)

2.1.0 (2016-11-08)

  • #370 Add Headers#include? (@ixti)

  • #364 Add HTTP::Response#connection (@janko-m)

  • #362 connect_ssl uses connect_timeout (Closes #359) ([@TiagoCardoso1983])

2.0.3 (2016-08-03)

2.0.2 (2016-06-24)

  • #353 Avoid a dependency cycle between Client and Connection classes. (@jhbabon)

2.0.1 (2016-05-12)

  • #341 Refactor some string manipulations so they are more performant (up to 3-4x faster) and more concise. (@tonyta)

  • #339 Always use byte methods when writing/slicing the write buffer. (@zanker)

2.0.0 (2016-04-23)

  • #333 Fix HTTPS request headline when sent via proxy. (@Connorhd)

  • #331 Add #informational?, #success?, #redirect?, #client_error? and #server_error? helpers to Response::Status. (@mwitek)

  • #330 Support custom CONNECT headers (request/response) during HTTPS proxy requests. (@smudge)

  • #319 Drop Ruby 1.9.x support. (@ixti)

1.0.4 (2016-03-19)

1.0.3 (2016-03-16)

  • #314 Validate charset before forcing encoding. (@kylekyle)

  • #318 Remove redundant string allocations upon header names normalization. (@ixti)

1.0.2 (2016-01-15)

  • #295: Fix redirect following when used with persistent mode. (@ixti)

1.0.1 (2015-12-27)

1.0.0 (2015-12-25)

  • #265: Remove deprecations (@tarcieri):

    • HTTP::Chainable#with_follow (use #follow)
    • HTTP::Chainable#with, #with_headers (use #headers)
    • HTTP::Chainable#auth(:basic, ...) (use #basic_auth)
    • HTTP::Chainable#default_headers (use #default_options[:headers])
    • HTTP::Headers#append (use #add)
    • HTTP::Options#[] hash-like API deprecated in favor of explicit methods
    • HTTP::Request#request_header (use #headline)
    • HTTP::Response::STATUS_CODES (use HTTP::Status::REASONS)
    • HTTP::Response::SYMBOL_TO_STATUS_CODE (no replacement)
    • HTTP::Response#status_code (use #status or #code)
    • HTTP::Response::Status#symbolize (use #to_sym)
  • #269: Close connection in case of error during request. (@ixti)

  • #271: High-level exception wrappers for low-level I/O errors. (@ixti)

  • #273: Add encoding option. (@connorhd)

  • #275: Support for disabling Nagle's algorithm with HTTP.nodelay. (@nerdrew)

  • #276 Use Encoding::BINARY as the default encoding for HTTP::Response::Body. (@tarcieri)

  • #278 Use an options hash for HTTP::Request initializer API. (@ixti)

  • #279 Send headers and body in one write if possible. This avoids a pathological case in Nagle's algorithm. (@tarcieri)

  • #281 Remove legacy 'Http' constant alias to 'HTTP'. (@tarcieri)

0.9.9 (2016-03-16)

  • BACKPORT #318 Remove redundant string allocations upon header names normalization. (@ixti)

  • BACKPORT #295: Fix redirect following when used with persistent mode. (@ixti)

0.9.8 (2015-09-29)

  • #260: Fixed global timeout persisting time left across requests when reusing connections. (@zanker)

0.9.7 (2015-09-19)

  • #258: Unified strategy for handling exception-based and exceptionless non-blocking I/O. Fixes SSL support on JRuby 9000. (@tarcieri)

0.9.6 (2015-09-06)

  • #254: Removed use of an ActiveSupport specific method #present? (@tarcieri)

0.9.5 (2015-09-06)

  • #252: Fixed infinite hang/timeout when a request contained more than ~16,363 bytes. (@zanker)

0.9.4 (2015-08-26)

  • #246: Fixes regression when body streaming was failing on some URIs. (@zanker)
  • #243: Fixes require timeout statements. (@ixti)

0.9.3 (2015-08-19)

  • #246: Fixed request URI normalization. (@ixti)
    • Avoids query component normalization
    • Omits fragment component in headline

0.9.2 (2015-08-18)

  • Fixed exceptionless NIO EOF handling. (@zanker)

0.9.1 (2015-08-14)

  • #246: Fix params special-chars escaping. (@ixti)

0.9.0 (2015-07-23)

  • #240: Support for caching removed. (@tarcieri)
  • JRuby 9000 compatibility

0.8.14 (2015-08-19)

  • Backport request URI normalization fixes from master. (@ixti)

0.8.13 (2015-08-14)

  • Backport params special-chars escaping fix from v0.9.1. (@ixti)

0.8.12 (2015-05-26)

  • Fix HTTP.timeout API (was loosing previously defined options). (@ixti)

0.8.11 (2015-05-22)

0.8.10 (2015-05-14)

  • Fix cookie headers generation. (@ixti)

0.8.9 (2015-05-11)

0.8.8 (2015-05-09)

0.8.7 (2015-05-08)

  • Fix HTTP.timeout API with options only given. (@ixti)

0.8.6 (2015-05-08)

  • #215: Reset global timeouts after the request finishes. (@zanker)

0.8.5 (2015-05-06)

  • #205: Add simple timeouts configuration API. (@ixti)
  • Deprecate Request#request_header. Use Request#headline instead. (@ixti)

0.8.4 (2015-04-23)

  • Deprecate #default_headers and #default_headers=. (@ixti)
  • #207: Deprecate chainable methods with with_ prefix. (@ixti)
  • #186: Add support of HTTPS connections through proxy. (@Connorhd)

0.8.3 (2015-04-07)

  • #206: Fix request headline. (@ixti)
  • Remove deprecated Request#__method__. (@ixti)

0.8.2 (2015-04-06)

  • #203: Fix Celluloid::IO compatibility. (@ixti)
  • Cleanup obsolete code. (@zanker)

0.8.1 (2015-04-02)

0.8.0 (2015-04-01)

  • #199: Properly handle WaitWritable for SSL. (@zanker)
  • #197: Add support for non-ASCII URis. (@ixti)
  • #187, #194, #195: Add configurable connection timeouts. (@zanker)
  • #179: Refactor requests redirect following logic. (@ixti)
  • Support for persistent HTTP connections (@zanker)
  • #77, #177: Add caching support. (@Asmod4n, @pezra)
  • #176: Improve servers used in specs boot up. Issue was initially raised up by @olegkovalenko. (@ixti)
  • Reflect FormData rename changes (FormData -> HTTP::FormData). (@ixti)
  • #173: HTTP::Headers now raises HTTP::InvalidHeaderNameError in case of (surprise) invalid HTTP header field name (e.g."Foo:Bar"). (@ixti)

0.7.3 (2015-03-24)

  • SECURITY FIX: http.rb failed to call the #post_connection_check method on SSL connections. This method implements hostname verification, and without it http.rb was vulnerable to MitM attacks. The problem was corrected by calling #post_connection_check (CVE-2015-1828) (@zanker)

0.7.2 (2015-03-02)

  • Swap from form_data to http-form_data (changed gem name).

0.7.1 (2015-01-03)

  • Gemspec fixups
  • Remove superfluous space in HTTP::Response inspection

0.7.0 (2015-01-02)

  • #73, #167: Add support of multipart form data. (@ixti)
  • Fix URI path normalization: https://github.com -> https://github.com/. (@ixti)
  • #163, #166, #152: Fix handling of EOF which caused infinite loop. (@mickm, @ixti)
  • Drop Ruby 1.8.7 support. (@ixti)
  • #150: Fix default Host header value. (@ixti)
  • Remove BearerToken authorization header. (@ixti)
  • #auth sugar now accepts only string value of Authorization header. Calling #auth(:basic, opts) is deprecated, use #basic_auth(opts) instead. (@ixti)
  • Fix handling of chunked responses without Content-Length header. (@ixti)
  • Remove HTTP::Request#method and deprecate HTTP::Request#__method__ (@sferik)
  • Deprecate HTTP::Response::STATUS_CODES, use HTTP::Response::Status::REASONS instead (@ixti)
  • Deprecate HTTP::Response::SYMBOL_TO_STATUS_CODE (@ixti)
  • Deprecate HTTP::Response#status_code (@ixti)
  • HTTP::Response#status now returns HTTP::Response::Status. (@ixti)
  • HTTP::Response#reason and HTTP::Response#code are proxies them to corresponding methods of HTTP::Response#status (@ixti)
  • Rename HTTP.with_follow to HTTP.follow and mark former one as being deprecated (@ixti)
  • Delegate HTTP::Response#readpartial to HTTP::Response::Body (@ixti)

0.6.4 (2015-03-25)

  • SECURITY FIX: http.rb failed to call the #post_connection_check method on SSL connections. This method implements hostname verification, and without it http.rb was vulnerable to MitM attacks. The problem was corrected by calling #post_connection_check (CVE-2015-1828) (@zanker, backported by @nicoolas25)

0.6.3 (2014-11-14)

  • #166: Backported EOF fix from master branch. (@ixti)

0.6.2 (2014-08-06)

  • #150: Fix default Host header value. (@ixti)
  • Deprecate BearerToken authorization header. (@ixti)
  • Fix handling of chunked responses without Content-Length header. (@ixti)
  • Rename HTTP.with_follow to HTTP.follow and mark former one as being deprecated (@ixti)

0.6.1 (2014-05-07)

  • Fix request Content-Length calculation for Unicode (@challengee)
  • Add Response#flush (@ixti)
  • Fix Response::Body#readpartial default size (@hannesg, @ixti)
  • Add missing CRLF for chunked bodies (@hannesg)
  • Fix forgotten CGI require (@ixti)
  • Improve README (@tarcieri)

0.6.0 (2014-04-04)

  • Rename HTTP::Request#method to HTTP::Request#verb (@krainboltgreene)
  • Add HTTP::ResponseBody class (@tarcieri)
  • Change API of response on HTTP::Client.request and "friends" (#get, #post, etc) (@tarcieri)
  • Add HTTP::Response#readpartial (@tarcieri)
  • Add HTTP::Headers class (@ixti)
  • Fix and improve following redirects (@ixti)
  • Add HTTP::Request#redirect (@ixti)
  • Add HTTP::Response#content_type (@ixti)
  • Add HTTP::Response#mime_type (@ixti)
  • Add HTTP::Response#charset (@ixti)
  • Improve error message upon invalid URI scheme (@ixti)
  • Consolidate errors under common HTTP::Error namespace (@ixti)
  • Add easy way of adding Authorization header (@ixti)
  • Fix proxy support (@hundredwatt)
  • Fix and improve query params handing (@jwinter)
  • Change API of custom MIME type parsers (@ixti)
  • Remove HTTP::Chainable#with_response (@ixti)
  • Remove HTTP::Response::BodyDelegator (@ixti)
  • Remove HTTP::Response#parsed_body (@ixti)
  • Bump up input buffer from 4K to 16K (@tarcieri)
# Main API change you will mention is that `request` method and it's
# syntax sugar helpers like `get`, `post`, etc. now returns Response
# object instead of BodyDelegator:

response = HTTP.get "http://example.com"
raw_body = HTTP.get("http://example.com").to_s
parsed_body = HTTP.get("http://example.com/users.json").parse

# Second major change in API is work with request/response headers
# It is now delegated to `HTTP::Headers` class, so you can check it's
# documentation for details, here we will only outline main difference.
# Duckface (`=`) does not appends headers anymore

request[:content_type] = "text/plain"
request[:content_type] = "text/html"
request[:content_type] # => "text/html"

# In order to add multiple header values, you should pass array:

request[:cookie] = ["foo=bar", "woo=hoo"]
request[:cookie] # => ["foo=bar", "woo=hoo"]

# or call `#add` on headers:

request.headers.add :accept, "text/plain"
request.headers.add :accept, "text/html"
request[:accept] # => ["text/plain", "text/html"]

# Also, you can now read body in chunks (stream):

res = HTTP.get "http://example.com"
File.open "/tmp/dummy.bin", "wb" do |io|
  while (chunk = res.readpartial)
    io << chunk
  end
end

Changes discussion

0.5.1 (2014-05-27)

  • Backports redirector fixes from 0.6.0 (@ixti)
  • EOL of 0.5.X branch.

0.5.0 (2013-09-14)

  • Add query string support
  • New response delegator allows HTTP.get(uri).response
  • HTTP::Chainable#stream provides a shorter alias for with_response(:object)
  • Better string inspect for HTTP::Response
  • Curb compatibility layer removed

0.4.0 (2012-10-12)

  • Fix bug accessing https URLs
  • Fix several instances of broken redirect handling
  • Add default user agent
  • Many additional minor bugfixes

0.3.0 (2012-09-01)

  • New implementation based on tmm1's http_parser.rb instead of Net::HTTP
  • Support for following redirects
  • Support for request body through {:body => ...} option
  • HTTP#with_response (through Chainable)

0.2.0 (2012-03-05)

  • Request and response objects
  • Callback system
  • Internal refactoring ensuring true chainability
  • Use the certified gem to ensure SSL certificate verification

0.1.0 (2012-01-26)

  • Testing against WEBrick
  • Curb compatibility (require 'http/compat/curb')

0.0.1 (2011-10-11)

  • Initial half-baked release

0.0.0 (2011-10-06)

  • Vapoware release to claim the "http" gem name >:D