Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions http/roundtrip_js.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ func (t *Transport) RoundTrip(req *Request) (*Response, error) {
// to fall back on the Fetch API, unless it's not available.

// TINYGO: Dial/DialTLS & DialContext/DialTLSContext are not present in tinygo Transport struct, therefore the
// corresponding if statements were removed
// corresponding if statements were removed.
// TINYGO: t.roundTrip (the private fallback used by upstream Go) is not present in the TinyGo stub
// Transport, so return an error when the Fetch API is unavailable instead of calling it.
if jsFetchMissing || jsFetchDisabled {
return t.roundTrip(req)
return nil, errors.New("net/http: Fetch API is not available and no fallback transport is implemented for js/wasm")
}

ac := js.Global().Get("AbortController")
Expand Down