Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 4eb196c

Browse files
authoredOct 27, 2020
fix: do not double normalise input url (#3351)
No need to do this twice. Fixes #3331
1 parent 33aa632 commit 4eb196c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed
 

‎packages/ipfs-http-client/src/lib/core.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,10 +122,11 @@ class Client extends HTTP {
122122
*/
123123
constructor (options = {}) {
124124
const opts = normalizeInput(options)
125+
125126
super({
126127
timeout: parseTimeout(opts.timeout) || 60000 * 20,
127128
headers: opts.headers,
128-
base: normalizeInput(opts.url).toString(),
129+
base: `${opts.url}`,
129130
handleError: errorHandler,
130131
transformSearchParams: (search) => {
131132
const out = new URLSearchParams()

‎packages/ipfs-http-client/test/constructor.spec.js

+8
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ describe('ipfs-http-client constructor tests', () => {
8686
const ipfs = ipfsClient({ host, port, apiPath })
8787
expectConfig(ipfs, { host, port, apiPath })
8888
})
89+
90+
it('url', () => {
91+
const host = '10.100.100.255'
92+
const port = '9999'
93+
const apiPath = '/future/api/v1/'
94+
const ipfs = ipfsClient({ url: `http://${host}:${port}${apiPath}` })
95+
expectConfig(ipfs, { host, port, apiPath })
96+
})
8997
})
9098

9199
describe('integration', () => {

0 commit comments

Comments
 (0)
This repository has been archived.