Open andresgutgon opened 2 months ago
I think the issue could be here no? https://github.com/Netflix/pollyjs/blob/master/packages/%40pollyjs/core/src/-private/http-base.js#L104
req.headers
are freeze so I can't modify them.
Is there any other way of obfuscate headers values?
I ended up using beforeResponse
instead of beforePersist
and it worked well. No freezing of objects here.
Out of curiosity, did ChatGPT tell you to use beforePersist
?
Description
Hi, thanks for this tool looks super helpful. So far is going well I manage to setup Polly.js and Vitest when testing a AWS Endpoint that is accessed using AWS JS SDK.
The problem is when I try to obfuscate headers for security reasons.
Shareable Source
This is the relevant part
Then I use this
useCassettes
in my tests like this:Error Message & Stack Trace
I'm getting the error when trying to modify the headers
beforePersits
Dependencies
Environment