ericclemmons/node-recorder

Ignore headers by default?

ericclemmons opened this issue · 1 comments

There seems to be more surprises by how hashing operates, considering headers.

So, either there could be a hash option for customizing...

Or, normalize can choose to return the normalized object (instead of mutating), where returning undefined will keep normal normalization.

(I still think that Polly.js does a good job of hashing headers with matchRequsestsBy: https://netflix.github.io/pollyjs/#/configuration?id=defaults)

In practice, I've found that the best place to pay attention to headers is within the tests themselves.

When a request is made, I think it's better to have something like x-recorder-headers: ["x-test-id", "x-custom-header"] to specify what you want to keep.