vcr icon indicating copy to clipboard operation
vcr copied to clipboard

Somehow make redirects work

Open sckott opened this issue 2 years ago • 3 comments

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 avatar Jan 16 '24 23:01 sckott

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

sckott avatar Feb 04 '24 16:02 sckott