assaf / node-replay

When API testing slows you down: record and replay HTTP responses like a boss
http://documentup.com/assaf/node-replay
MIT License
522 stars 107 forks source link

Ignore parameters by name #76

Open strarsis opened 8 years ago

strarsis commented 8 years ago

Github API requests can contain access_token parameter which value got sensitive data. I could remove or overwrite its value, however, then replay wouldn't get a hit for the request anymore as it checks for this parameter, too. How can I let replay ignore this parameter?

albertogasparin commented 6 years ago

Just manually change the get url to a regular expression. E.g. from:

GET /endpoint?access_token=ASD123456

to:

GET REGEXP /\/endpoint\?access_token=[^&]+/

This way replay will match the url no matter the token, but it will still fail if the token is missing to empty