You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The undici based fetch (exposed as globalThis.fetch in Node 18 and up) doesn't work out of the box with global-agent which we use to proxy the requests through Jambox.
There are some workarounds mentioned on this issue: gajus/global-agent#52, particularly this one: gajus/global-agent#52 (comment) which seems like a good thing to consider doing inside Jambox to normalize the fetch handling/proxying.
Thought about applying this in our application code but other apps probably want a similar fix as well.
There is some traction on an issue for the Node steering committee to standardize this which should make this code obsolete, but who knows when that will land, see: nodejs/node#43187
The text was updated successfully, but these errors were encountered:
This change patches `undici` which is what `globalThis.fetch` uses in
modern Node versions (18+), allowing for native fetches to also be
routed through the proxy (`mockttp`) in Jambox!
Closes: #51
The
undici
basedfetch
(exposed asglobalThis.fetch
in Node 18 and up) doesn't work out of the box withglobal-agent
which we use to proxy the requests through Jambox.There are some workarounds mentioned on this issue: gajus/global-agent#52, particularly this one: gajus/global-agent#52 (comment) which seems like a good thing to consider doing inside Jambox to normalize the
fetch
handling/proxying.Thought about applying this in our application code but other apps probably want a similar fix as well.
There is some traction on an issue for the Node steering committee to standardize this which should make this code obsolete, but who knows when that will land, see: nodejs/node#43187
The text was updated successfully, but these errors were encountered: