Join GitHub today
net/http: Expose the normal transport RoundTripper for WASM/js #27495
On WASM, the standard
There are use cases for using the normal RoundTripper, for instance for testing and simulation in the browser. The normal RoundTripper is compiled and included in the binary anyway, and works perfectly well, but is masked by the browser version.
What version of Go are you using (
I quickly tested two hacks to do this, and both seemed to work. Both pass the tests on normal platforms, but I don't know how to run the unit tests on WASM.
Hack 1: Don't implement the special RoundTripper on
Hack 2: Mod the special RoundTripper to instead use the normal RoundTripper if the caller has set options on the Transport. Example: 8137bf5