Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added options to ignore cookie headers for tape hash creation and recording a specific range of status codes #22

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

DylanFC
Copy link

@DylanFC DylanFC commented Aug 13, 2016

I added the following options to suit my particular needs:
options.recordStatusCodes: Array of integers length 2, e.g. [200, 300]
options.ignoreCookies: true|false

I'm only interested in recording status codes of successful requests, so I'm using this with the range [200,300] in case there are any backend issues when a tape doesn't already exist.

Moreover, my backend uses cookie based sessions so I have to authenticate before making a request to the server. However I don't want to authenticate if there is already a tape recorded. Therefore I need the tape hashes to be created without the cookie header playing a part, as subsequent requests will not have this cookie and therefore would not get the tape that was saved.

Thought these options might be helpful, and thanks for creating this!

@king4sam
Copy link

hey @DylanFC
I got a similar problem
I only care about the request url, however the cookie in header would also effect the original hashcode. It make yakbak thought that the request is different every time even they have the same request URL.
Finally, I found that the self-define hashcode function in setting could solve the problem.
for my example,
hash:function(req,body){ return req .url.hashcode(); }
then the name of recorded tape would be the same if they are from same requestURL.

@yahoocla
Copy link

Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants