Skip to content

3.35.0

Latest

Choose a tag to compare

@bblimke bblimke released this 18 Nov 08:02
  • Fix get_file with Patron 1.1 (#1147)

    Previously, with Patron 1.1, get_file ignored stubs: it made a real request and wrote the real response to the file, even when real connections were disabled.

    With Patron 1.1, a stubbed get_file returns a response with a nil body, as Patron does. Read the body from the file.

    Thanks to Bob Aman

  • Stub and block streamed requests with Patron 1.1 (#1147)

    Previously, WebMock did not see requests made with Session#stream or the get_stream, post_stream, put_stream and patch_stream methods added in Patron 1.1, so they always reached the network.

    A stubbed streamed request yields a stream that reads the stubbed body, and returns a Patron::TransferStats. After-request callbacks run before the block, so they also run when the block exits early. For a real streamed request, callbacks receive the status and headers without the body.

    Thanks to Bob Aman

  • Fix Patron digest authentication when real requests are allowed

    Previously, when a Patron session had a username and password and a request reached the network, WebMock added an Authorization: Basic ... header to it. A session with auth_type: :digest sent the password in that header instead of waiting for the server's digest challenge.

  • Fix a deprecation warning with Patron 1.0 and later (#1142)

    Previously, the first stubbed request printed Patron::Response.new with positional arguments is deprecated.

    Thanks to Julik Tarkhanov

  • Fix require "webmock" failing next to other libraries that define HTTP::VERSION (#1139)

    Previously, WebMock loaded its adapter for the http gem whenever a top-level HTTP with a VERSION was defined. Other libraries define one too, such as the gem published on RubyGems as http.rb (a different gem from http, which is also called http.rb). With such a library installed, require "webmock" raised NameError: undefined method 'perform' for class 'HTTP::Client'.

    Thanks to thoran

  • Fix matching of indexed params with more than ten entries (#1141)

    Previously, WebMock ordered indexed params such as a[0] to a[10] as text, so a[10] came right after a[1]. A stub with the values in index order, such as with(body: {"a" => [...]}), did not match a form body with more than ten indexed values, or a query with more than ten indexed hashes.

    If a stub lists such values in the old order, for example one copied from WebMock's suggested stub, put them in index order.

    Thanks to Andrii Furmanets