Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Bump webmock from 3.26.4 to 3.36.0 - #106

Closed
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/bundler/webmock-3.36.0
Closed

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/bundler/webmock-3.36.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 23, 2026

Copy link
Copy Markdown
Contributor

Bumps webmock from 3.26.4 to 3.36.0.

Release notes

Sourced from webmock's releases.

3.36.0

  • Fix matching of indexed arrays nested inside arrays of hashes (#1144)

    Previously, WebMock read indexed arrays nested inside an array of hashes, such as a[][b][0][c]=1, as hashes with "0", "1" keys. WebMock writes that form itself, so with(query: {"a" => [{"b" => [{"c" => "1"}]}]}) with a regexp URI did not match ?a[][b][][c]=1, and a Typhoeus request with that hash as its body did not match a stub with the same hash.

    If a stub uses the old shape, such as {"a" => [{"b" => {"0" => {"c" => "1"}}}]}, for example one copied from WebMock's suggested stub, use arrays instead.

    Thanks to Hamza Tarar

  • Fix matching of arrays of hashes that repeat a nested key

    Previously, WebMock put a nested key repeated under [] into the first hash of the array, so items[][address][city]=X&items[][address][city]=Y was read as one item with the city Y. A stub listing both items did not match, and a stub for X and Y also matched a request for Z and Y. Rails and Faraday encode arrays of nested hashes this way.

    Such keys now go into a new hash, as in Rack. If a stub lists such an array as one item, for example one copied from WebMock's suggested stub, list every item.

    Queries that mix a value and nested keys under the same name, such as a[][b]=1&a[][b][c]=2 or a[c]=1&a[c][]=2, no longer raise IndexError or join the values into one string.

  • Apply Net::HTTP response_body_encoding to stubbed response bodies (#1138)

    Previously, stubbed Net::HTTP responses ignored Net::HTTP#response_body_encoding= and Net::HTTPResponse#body_encoding=. A body stubbed as binary, for example from a raw response file, stayed ASCII-8BIT even with http.response_body_encoding = true and a Content-Type of text/plain; charset=utf-8.

    Stubbed bodies now get the encoding real responses get: with true, the charset from the Content-Type header or an HTML <meta> tag, and otherwise the encoding the setting names. Without the setting, a body keeps the encoding it was stubbed with.

    Thanks to Yang Bai

  • Give each stubbed Net::HTTP response its own copy of the body

    Previously, a stubbed Net::HTTP response returned the stubbed body string itself. A body stubbed with a frozen string, such as a literal in a file with # frozen_string_literal: true, made response.body.force_encoding("UTF-8") raise FrozenError, which a real response never does. Changing the body in place, for example with response.body << "!", changed it for later requests to the same stub too.

  • Keep the size of async-http responses to HEAD requests (#1143)

    async-http gives the size of a response to a HEAD request as response.body.length, not as a header. Previously, a response stubbed with stub_request(:head, url).to_return(headers: {"Content-Length" => "42"}) ignored the Content-Length: its body was nil over HTTP/1 and had a length of 0 over HTTP/2. A real response lost its size, with a nil body, when a WebMock.after_request callback was registered, for example while VCR was recording, and the recorded response had no Content-Length.

    A stubbed response now takes its size from the stubbed Content-Length, or from the stubbed body without one, as before. A real response keeps its size when a callback is registered, and the recorded response has it as its Content-Length.

    Thanks to Andrew K. Fader

  • Keep the URI query of HTTPClient requests that pass a query argument (#1145)

    Previously, WebMock dropped the query in the URI when an HTTPClient request also passed the query argument. HTTPClient.new.get("http://example.com/?a=1", {"b" => "2"}) requests /?a=1&b=2, but WebMock saw /?b=2, and with {} as the query argument it saw no query at all. A stub or a_request expectation could match a URL that was never requested.

    If a stub or expectation for such a request leaves out the query in the URI, add it, for example stub_request(:get, "http://example.com/?a=1&b=2"). Record VCR cassettes with such requests again.

    Thanks to AmeenKhan12345

3.35.0

  • 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.

... (truncated)

Changelog

Sourced from webmock's changelog.

3.36.0

  • Fix matching of indexed arrays nested inside arrays of hashes (#1144)

    Previously, WebMock read indexed arrays nested inside an array of hashes, such as a[][b][0][c]=1, as hashes with "0", "1" keys. WebMock writes that form itself, so with(query: {"a" => [{"b" => [{"c" => "1"}]}]}) with a regexp URI did not match ?a[][b][][c]=1, and a Typhoeus request with that hash as its body did not match a stub with the same hash.

    If a stub uses the old shape, such as {"a" => [{"b" => {"0" => {"c" => "1"}}}]}, for example one copied from WebMock's suggested stub, use arrays instead.

    Thanks to Hamza Tarar

  • Fix matching of arrays of hashes that repeat a nested key

    Previously, WebMock put a nested key repeated under [] into the first hash of the array, so items[][address][city]=X&items[][address][city]=Y was read as one item with the city Y. A stub listing both items did not match, and a stub for X and Y also matched a request for Z and Y. Rails and Faraday encode arrays of nested hashes this way.

    Such keys now go into a new hash, as in Rack. If a stub lists such an array as one item, for example one copied from WebMock's suggested stub, list every item.

    Queries that mix a value and nested keys under the same name, such as a[][b]=1&a[][b][c]=2 or a[c]=1&a[c][]=2, no longer raise IndexError or join the values into one string.

  • Apply Net::HTTP response_body_encoding to stubbed response bodies (#1138)

    Previously, stubbed Net::HTTP responses ignored Net::HTTP#response_body_encoding= and Net::HTTPResponse#body_encoding=. A body stubbed as binary, for example from a raw response file, stayed ASCII-8BIT even with http.response_body_encoding = true and a Content-Type of text/plain; charset=utf-8.

    Stubbed bodies now get the encoding real responses get: with true, the charset from the Content-Type header or an HTML <meta> tag, and otherwise the encoding the setting names. Without the setting, a body keeps the encoding it was stubbed with.

    Thanks to Yang Bai

  • Give each stubbed Net::HTTP response its own copy of the body

    Previously, a stubbed Net::HTTP response returned the stubbed body string itself. A body stubbed with a frozen string, such as a literal in a file with # frozen_string_literal: true, made response.body.force_encoding("UTF-8") raise FrozenError, which a real response never does. Changing the body in place, for example with response.body << "!", changed it for later requests to the same stub too.

  • Keep the size of async-http responses to HEAD requests (#1143)

    async-http gives the size of a response to a HEAD request as response.body.length, not as a header. Previously, a response stubbed with stub_request(:head, url).to_return(headers: {"Content-Length" => "42"}) ignored the Content-Length: its body was nil over HTTP/1 and had a length of 0 over HTTP/2. A real response lost its size, with a nil body, when a WebMock.after_request callback was registered, for example while VCR was recording, and the recorded response had no Content-Length.

    A stubbed response now takes its size from the stubbed Content-Length, or from the stubbed body without one, as before. A real response keeps its size when a callback is registered, and the recorded response has it as its Content-Length.

    Thanks to Andrew K. Fader

  • Keep the URI query of HTTPClient requests that pass a query argument (#1145)

    Previously, WebMock dropped the query in the URI when an HTTPClient request also passed the query argument. HTTPClient.new.get("http://example.com/?a=1", {"b" => "2"}) requests /?a=1&b=2, but WebMock saw /?b=2, and with {} as the query argument it saw no query at all. A stub or a_request expectation could match a URL that was never requested.

    If a stub or expectation for such a request leaves out the query in the URI, add it, for example stub_request(:get, "http://example.com/?a=1&b=2"). Record VCR cassettes with such requests again.

    Thanks to AmeenKhan12345

3.35.0

  • Fix get_file with Patron 1.1 (#1147)

... (truncated)

Commits
  • a9a6fc0 Version 3.36.0
  • 622fbf0 Tidy #1145 and document it
  • 4bd2170 Merge pull request #1145 from AmeenKhan12345/fix-httpclient-uri-query-dropped
  • 18c1092 Tidy #1143, keep the size of every real HEAD response
  • e06de88 Merge pull request #1143 from andrewfader/async-http-head-content-length
  • 27cd96f Tidy #1138, apply the encoding once and copy stubbed bodies
  • 14defa9 Merge pull request #1138 from ybai08/net-http-response-body-encoding
  • b55c6c8 Merge pull request #1146 from sporkmonger/net-http-start-host-name
  • 62bf051 Start a new hash when a nested key repeats under []
  • d8a27e9 Tidy #1144 and document it
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [webmock](https://github.com/bblimke/webmock) from 3.26.4 to 3.36.0.
- [Release notes](https://github.com/bblimke/webmock/releases)
- [Changelog](https://github.com/bblimke/webmock/blob/master/CHANGELOG.md)
- [Commits](bblimke/webmock@v3.26.4...v3.36.0)

---
updated-dependencies:
- dependency-name: webmock
  dependency-version: 3.36.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file ruby Pull requests that update ruby code labels Nov 23, 2026
@dependabot @github

dependabot Bot commented on behalf of github Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #108.

@dependabot dependabot Bot closed this Nov 25, 2026
@dependabot
dependabot Bot deleted the dependabot/bundler/webmock-3.36.0 branch November 25, 2026 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file ruby Pull requests that update ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants