bblimke / webmock

Library for stubbing and setting expectations on HTTP requests in Ruby.
MIT License
3.98k stars 555 forks source link

Patron adapter does not currently "follow" redirects #1071

Open foca opened 1 month ago

foca commented 1 month ago

Patron, as a wrapper of libcurl, works similarly to Curb where if you set max_redirects on a request, it will follow them automatically, and then return the "last" URL requested as response.url.

WebMock already handles this for Curb, but does not do it for Patron.

bblimke commented 1 month ago

@foca thank you for reporting.

In case of Curb, one needs to set follow_location to true. I believe Patron follows redirects by default.

I also noticed that Curb adapter doesn't support max_redirects setting.