ropensci / vcr

Record and replay HTTP requests
https://docs.ropensci.org/vcr
Other
77 stars 12 forks source link

Somehow make redirects work #267

Open sckott opened 10 months ago

sckott commented 10 months ago

This works fine,

use_cassette("aaa", {
    GET("https://google.com")
})

But then any subsequent run of the same code block

use_cassette("aaa", {
    GET("https://google.com")
})

absofrutely does not work because https://google.com redirects to https://www.google.com, and the https://www.google.com is what's stored in the cassette.

Probably (question mark?) best to capture this and warn the user. Given that we're capturing the requests/responses anyway, I think it would be easy enough to warn if there's either a 301 or similar code, and then tell the user to probably update their request with the new url

🤔 🤔 🤔

sckott commented 9 months ago

Ruby vcr just records all requests when there's a redirect, then matching works just fine. Should be doable ?