yakbak icon indicating copy to clipboard operation
yakbak copied to clipboard

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

Open DylanFC opened this issue 8 years ago • 2 comments

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!

DylanFC avatar Aug 13 '16 00:08 DylanFC

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.

king4sam avatar Jun 13 '18 17:06 king4sam

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! :smile:

yahoocla avatar Jun 13 '18 17:06 yahoocla