This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
HTTP client factory: Invalid base URL #3332
Labels
need/triage
Needs initial labeling and prioritization
js-ipfs version: 0.49.1-84cfa553ffc717d5d8bf94fdf6a306f182c9aee4
interface-ipfs-core version: ^0.139.1
ipfs-http-client version: ^46.0.1
Repo version: 8
System version: x64/darwin
Node.js version: v14.7.0
Commit: 84cfa55
MacOS Catalina 10.15.6
Darwin acostalima 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
React Native v0.63.2 (tracking RN support at #2813)
HTTP client
Severity:
High (?)
Description:
Call the HTTP client factory with a valid URL to create a new client. The factory throws with
TypeError
(Invalid base URL).Steps to reproduce the error:
Issue #3331 has to be fixed first in order to reproduce this one.
I've traced the issue down to:
js-ipfs/packages/ipfs-http-client/src/lib/core.js
Line 28 in 4b8021d
and the root cause lies in https://github.com/hugomrdias/iso-url/blob/master/src/url-browser.js#L3 (CC @hugomrdias).
The default value for
base
cannot be resolved to''
. In fact, as per spec, if left unspecified it should beundefined
. The statementnew URL('http://localhost:5002', '')
throws in Chrome, Firefox and Node.I'll gladly open a PR to fix this.
The text was updated successfully, but these errors were encountered: