parroty / exvcr

HTTP request/response recording library for elixir, inspired by VCR.
MIT License
722 stars 132 forks source link

Add ignore url/host to config #94

Open tgautier opened 7 years ago

tgautier commented 7 years ago

Hi,

We're using ExVCR and we're very happy with it but sometimes we have an issue with some requests that we don't want to be intercepted.

We've looked at the README thoroughly but haven't find any clue about how to do this. We've also looked at the doc and still no clue...

Would you be interested in adding such a functionnality to ExVCR?

I guess something like an attribute that we can add in the config like an array of strings or regexes:

config :exvcr, [
  # ...
  ignore_urls: ["https://www.iana.org/time-zones/repository/tzdata-latest.tar.gz", ~r(^https://\w+.iana.org/.*)]
]

We can of course do a pull request if you're ok with it, we just want to check before we invest some hours of dev. 😉

Cheers!

parroty commented 7 years ago

Thanks for the feedback.

We're using ExVCR and we're very happy with it but sometimes we have an issue with some requests that we don't want to be intercepted.

Can I assume that if the request url is matched with one of the ignore_urls, the expected behavior is just pass through the request to server?

We can of course do a pull request if you're ok with it, we just want to check before we invest some hours of dev.

I think having the config parameter works, and pull request would be great. I assume it's related to around exvcr/handler.ex.

tgautier commented 7 years ago

Can I assume that if the request url is matched with one of the ignore_urls, the expected behavior is just pass through the request to server?

This is exactly the behavior I'd like to add.

I think having the config parameter works, and pull request would be great. I assume it's related to around exvcr/handler.ex.

Thanks for the hint, I'll try to get this working.