Closed Maxim-Mazurok closed 11 months ago
I'm refactoring msw-snapshot now.
The refactored version uses getSortedEntries
for this.
But it has some of the brealing changes.
The new version of msw-snapshot was published and it would solve this problem. Close for now.
Something changed the order of headers in my request, not sure what exactly, maybe node-fetch update.
And it resulted in new snapshots being generated.
This is the original
req.headers.raw()
:And this is sorted:
I used this function:
generated by GPT4: https://chat.openai.com/share/1b103ef9-723e-4b5a-9c88-a2179ba26f34
I will be using the following patch for now:
Caution is that technically order of headers can matter depending on server implementation, but that would be pretty unconventional server I think. Order of headers usually matters if you have headers with the same key, but since
req.headers.raw()
returns an object - all keys are already unique, so this shouldn't be an issue. Hope this helps someone!