LinkedInAttic / sepia

Sepia is a VCR-like module for node.js that records HTTP interactions, then plays them back exactly like the first time they were invoked
Apache License 2.0
279 stars 32 forks source link

Add includeHeaderValues option #23

Closed aneilbaboo closed 6 years ago

aneilbaboo commented 7 years ago

This PR provides the ability to include header values when generating the filename hash. This addresses #21.

Now you can do:

var sinon = require('sinon');
sinon.configure({ includeHeaderValues: true });

The generated hash will be sensitive to header values, and if a headerWhitelist is set only values from those headers will be used. Note that it is redundant to set includeHeaderNames when includeHeaderValues is set.

Note: To preserve backwards compatibility with existing filenames, I preserved “headerNames” in the hashparts array instead of renaming it to “headers” as would otherwise make sense.

aneilbaboo commented 7 years ago

@salvipriyanka @avik-das @delwyn @deepankgupta - Sorry to spam you all. Who is the right person to get this PR accepted?

palmerj3 commented 7 years ago

@aneilbaboo I also have a crucial PR I need merged... given that this repo appears abandoned what would you think about starting a new project based on a fork of this? Give it a different name so we can publish to NPM. And link to the original, of course, in the README. Thoughts?

aneilbaboo commented 7 years ago

@palmerj3 Yes, I've been thinking the same thing. It's been a long time and several attempts with no response.

I figured that to make this a living breathing project, we should start with a new name so we can have consistency between npm and github. "Replayer" was available, so I used that.

I created the fork at https://github.com/aneilbaboo/replayer, and made you a contributor. I just made the package available on NPM too, and it uses the same revision number. The only thing necessary should be renaming sepia=>replayer.

I made you a contributor.

aneilbaboo commented 7 years ago

I'll create an issue announcing the change.