gems webmock 3.33.0

latest release: 3.34.0
5 hours ago
  • Return effective_url as a String for stubbed Typhoeus responses (#869)

    Previously, this was an Addressable::URI. If your code calls methods such as effective_url.host, parse the returned string into a URI first.

    The URL keeps the request's port, query order and encoding. It follows curl's formatting: for example, http://example.com:80 becomes http://example.com:80/. Stubbed timeouts now provide an effective_url too.

    Thanks to Tom Brammar

  • Fix incorrect removal of default ports from displayed URLs

    WebMock could accidentally remove :80 or :443 from a URL's path or query. For example, an error message could show /foo/bar instead of /foo:80/bar.

    Only the host's default port is now removed. This also works when the port is immediately followed by a query string, as in http://example.com:80?a=b.

  • Set return_code to :ok for completed stubbed Typhoeus requests (#736)

    return_code is now :ok and return_message is now "No error"; both were previously nil. This includes HTTP error responses such as 404: :ok means the transfer completed. Stubbed timeouts still return :operation_timedout.

    Thanks to Michael Spiz

  • Fix the raw headers returned by stubbed Typhoeus responses

    The response_headers string now uses the stubbed HTTP status. For example, a 404 stub no longer reports HTTP/1.1 200 OK.

    Stubs without headers now return an empty headers hash ({}) instead of nil. Their response_headers contains the status line instead of being nil.

    The raw headers use binary string encoding, matching real responses. For timeouts, response_headers is now an empty string.

Don't miss a new webmock release

NewReleases is sending notifications on new releases.