Permalink
Commits on Feb 17, 2018
  1. Merge pull request #461 from nicolasleger/patch-1

    ixti committed Feb 17, 2018
    Ensure new Ruby 2.5 compatibility
Commits on Feb 15, 2018
  1. Fix failing spec

    janko-m committed Feb 15, 2018
    127.0.0.1:000 is interpreted by Adressable::URI as just 127.0.0.1 (with
    port 80), so a GET request to that URL won't raise an error if something
    is running on port 80.
Commits on Feb 14, 2018
  1. rename #prepare_request to #build_request

    tycooon authored and ixti committed Feb 12, 2018
  2. extract prepare_request method

    tycooon authored and ixti committed Feb 12, 2018
Commits on Feb 12, 2018
  1. Simplify test for large request bodies

    janko-m authored and ixti committed Feb 11, 2018
  2. Merge pull request #456 from janko-m/simplify-http-connection-read_he…

    tarcieri committed Feb 12, 2018
    …aders
    
    Simplify HTTP::Connection#read_headers!
Commits on Feb 11, 2018
Commits on Feb 4, 2018
Commits on Feb 3, 2018
  1. Removing unreacheable code in HTTP::Features::AutoDeflate

    esparta authored and ixti committed Feb 2, 2018
    On aa7c688 HTTP::Features::AutoDeflate got a major
    refactoring, delegating most of the work to their own classes
    (GzippedBody & DeflatedBody), but a branch preventing a wrong
    value passed to #deflated_body (`headers` params) was left behind.
    
    Currently the exception will never occur because the values of the property
    `method` are enforced on the initializer (accepting only gzip & deflated)
Commits on Feb 2, 2018
  1. Fix query string building for string with newlines

    mikegee authored and ixti committed Jan 16, 2018
    Expose `HTTP::URI#query_values` & `HTTP::URI#query_values=` which
    delegate to the underlying `Addressable::URI` instead of using
    Addressable's `form_encode` method.
  2. Merge pull request #434 from janko-m/remove-http-form-data-pre-releas…

    janko-m committed Feb 2, 2018
    …e-from-gemspec
    
    Remove http-form_data pre-release from gemspec
Commits on Jan 30, 2018
Commits on Jan 29, 2018
  1. Merge pull request #451 from janko-m/reduce-memory-usage-when-reading…

    ixti committed Jan 29, 2018
    …-response-body
    
    Reduce memory usage when reading response body
  2. Reduce memory usage when reading response body

    janko-m committed Jan 29, 2018
    Currently for each chunk read from the socket a new string is being
    allocated. This is not necessary, because we're feeding that string
    object into the HTTP parser and never using it again.
    
    So we initialize a buffer string and pass it in when reading chunks.
    This will make each chunk be read into the same buffer object, no new
    string will be allocated in that operation.
    
    In my benchmark this halves the allocated memory when downloading
    large response bodies.
Commits on Jan 18, 2018
  1. README.md: 2018

    tarcieri committed Jan 18, 2018
Commits on Jan 5, 2018
  1. Merge pull request #446 from mikegee/simplify-global-timeout

    ixti committed Jan 5, 2018
    Simplify setting a timeout
  2. Simplify setting timeouts

    mikegee committed Dec 31, 2017
    - `.timeout(<Numeric>)` sets a global timeout value.
    - `.timeout(connect: x, write: y, read: z)` sets per operation timeouts.
    
    The previous style: `.timeout(:global|:per_operation, hash_of_options)` doesn't work anymore.
  3. Quiet some RSpec warnings

    mikegee committed Jan 4, 2018
    These were too noisy for me:
    
    WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<NoMethodError: undefined method `fetch' for "[FOOBAR]":String>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /home/travis/build/httprb/http/spec/lib/http_spec.rb:252:in `block (3 levels) in <top (required)>'.
    
    WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<KeyError: key not found: :user>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /home/travis/build/httprb/http/spec/lib/http_spec.rb:260:in `block (3 levels) in <top (required)>'.
    
    WARNING: Using the `raise_error` matcher without providing a specific error or message risks false positives, since `raise_error` will match when Ruby raises a `NoMethodError`, `NameError` or `ArgumentError`, potentially allowing the expectation to pass without even executing the method you are intending to call. Actual error raised was #<KeyError: key not found: :pass>. Instead consider providing a specific error class or message. This message can be suppressed by setting: `RSpec::Expectations.configuration.on_potential_false_positives = :nothing`. Called from /home/travis/build/httprb/http/spec/lib/http_spec.rb:256:in `block (3 levels) in <top (required)>'.
Commits on Nov 13, 2017
  1. Merge pull request #438 from janko-m/make-request-body-source-accessible

    ixti committed Nov 13, 2017
    Add Request::Body#source
Commits on Nov 11, 2017
  1. Create deflated body right before streaming starts

    janko-m committed Nov 11, 2017
    This makes it easier for 3rd-party libraries to inspect and log the
    request body, because they can rely on HTTP::Request#body always
    returning a HTTP::Request::Body object, instead of a DeflatedBody object
    when :auto_deflate is enabled.
    
    We also define HTTP::Request::Body#== for easier testing.
Commits on Oct 23, 2017
  1. Add Request::Body#source

    janko-m committed Oct 23, 2017
    This makes it possible to access the original body object.
Commits on Oct 17, 2017
  1. Remove .ruby-version file

    janko-m authored and ixti committed Oct 14, 2017
    The HTTP.rb codebase runs just as well on other Ruby versions, it's not
    necessary to use 2.4.0 specifically. This is inconvenient when using
    rbenv, because rbenv will automatically try to switch to the version
    specified in .ruby-version, and complain if you don't have it installed.
Commits on Oct 16, 2017
  1. Merge pull request #436 from janko-m/raise-connection-error-on-socket…

    ixti committed Oct 16, 2017
    …-writing-exceptions
    
    Raise ConnectionError when writing to socket fails
Commits on Oct 14, 2017
  1. Raise ConnectionError when writing to socket fails

    janko-m committed Oct 14, 2017
    Writing to the TCP socket can also fail with various exceptions, just
    like when opening or reading from it. For example, it happened to me
    that an Errno::EPIPE exceptions was raised during file upload,
    presumably because the server closed the connection early.
    
    In order to be consistent with re-raising low-level exceptions as
    HTTP::ConnectionError when opening or reading from the TCP socket,
    we also add the same behaviour when writing to the socket.
Commits on Oct 13, 2017
Commits on Oct 1, 2017
  1. Bump up min requried version of ruby to 2.2

    ixti committed Oct 1, 2017
    It has to be done prior 3.0.0 release, so shame on me.
    Ruby 2.2 will be EOL soon, so I believe 4.x release should
    drop Ruby 2.2 support too. :D I might be too radical today though.
  2. Release v3.0.0

    ixti committed Oct 1, 2017
Commits on Sep 10, 2017
  1. Release v3.0.0.pre

    ixti committed Sep 10, 2017
  2. Drop Ruby < 2.2 support.

    ixti committed Sep 10, 2017
    Ruby 2.1 was EOLed 5+ months ago. In face of v3.0.0 release it's time
    to drop support of 2.0 and 2.1 for us too.