ijpiantanida / talkback

A simple HTTP proxy that records and playbacks requests
MIT License
283 stars 41 forks source link

Disable header matching or provide a matcher #66

Closed vladcosorg closed 2 years ago

vladcosorg commented 2 years ago

I've been using nock for a while and tried to migrate to your library. Much better, easier, great job!

They only issue we have is that our scraping axios client is randomising headers (user agent, etc) on each request. Thus the requests never get matched. Ignore headers is not an option, because there are over 20 headers that may or may not be randomised. Is it possible to provide header matcher function or disabled header matching all-together.

FYI https://github.com/nock/nock#enable_reqheaders_recording-option Nock does not bother matching the recordings by headers by default, because it brings a lot of similar issues....

ijpiantanida commented 2 years ago

Hi @chetzof, glad you find Talkback useful!

I think setting allowHeaders: [] should do what you need. Let me know if that doesn't work.