fetch
fetch copied to clipboard
Consider not mutating provided opts object
We are facing an issue when migrating from node-fetch
to @zeit/fetch
due to the fact that some of the properties in provided opts
object are mutated before calling the decorated fetch
function.
We are having issues mainly with headers, but I see the body is overwritten too.
Maybe it would be a good idea to copy provided opts and mutate the copy before passing to the wrapped fetch
instead? It would remove these unexpected side effects.
I think I could try to provide the fix if you are ok with it.
The implementation would be quite simple. Let me know if you want me to create the PR.
https://github.com/zeit/fetch/compare/master...celayale:feature/avoid-mutating-opts?expand=1
+1
Thank you for the report. We are archiving this project; you can read more details here: https://github.com/vercel/fetch/issues/83