-
Make a
Net::HTTPobject created while WebMock was enabled behave like any otherNet::HTTPobject afterWebMock.disable!(#1067)Such an object, like a connection cached by net-http-persistent or by Capybara with Selenium, used to raise
ArgumentErroronstartor a stubbed request, andWebMock::NetConnectNotAllowedErroron any other request, after WebMock was disabled. It now sends real requests until WebMock is enabled again.Thanks to Mike Taylor and James Rodovich
-
Connect again when a request is retried on a
Net::HTTPobject that WebMock started without connecting and whose first real connection failedSuch a retry used to raise
NoMethodError(undefined methodclosed?for nil). It now tries to connect again, and raises the connection error if that fails too. -
Drop the
Transfer-Encodingheader from stubbed async-http responses, as WebMock already does withContent-Length(#1044)A stub with a
Transfer-Encodingheader, such aschunked, used to fail with "Message contains both transfer encoding and content length". async-http sets both headers itself from the body, and its responses from real servers don't include them either.Thanks to Tim Mertens
-
Record requests made with curb's
http_patchas PATCH requests with their body (#1112)curb has
http_patchsince 1.0.8. WebMock recorded such a request as a GET, or as a POST afterpost_body=, so a PATCH stub never matched it.Thanks to Andy Williams
-
Record a curb request sent without a body as having none, even after an earlier
http_postorhttp_patchcall with a body on the sameCurl::EasyobjectFor example, after
c.http_post("a=1"),c.resetandc.http(:POST), the second request was recorded with the bodya=1, so a stub for that body matched it.