We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b5ae45 commit fb4bdb6Copy full SHA for fb4bdb6
src/net/http/roundtrip_js.go
@@ -12,8 +12,8 @@ import (
12
"io"
13
"net/http/internal/ascii"
14
"strconv"
15
- "strings"
16
"syscall/js"
+ "testing"
17
)
18
19
var uint8Array = js.Global().Get("Uint8Array")
@@ -53,8 +53,7 @@ var jsFetchMissing = js.Global().Get("fetch").IsUndefined()
53
//
54
// TODO(go.dev/issue/60810): See if it's viable to test the Fetch API
55
// code path.
56
-var jsFetchDisabled = js.Global().Get("process").Type() == js.TypeObject &&
57
- strings.HasPrefix(js.Global().Get("process").Get("argv0").String(), "node")
+var jsFetchDisabled = testing.Testing()
58
59
// RoundTrip implements the [RoundTripper] interface using the WHATWG Fetch API.
60
func (t *Transport) RoundTrip(req *Request) (*Response, error) {
0 commit comments