This repository was archived by the owner on Mar 10, 2020. It is now read-only.
This repository was archived by the owner on Mar 10, 2020. It is now read-only.
Configurable http.request protocol option #66
Closed
Description
Running ipfs-api from an on-disk "file:///.../index.html" does not work. Calling http.request without passing a protocol
in the opts, it will default to window.location.protocol
. This causes the following error:
TypeError: Failed to execute 'fetch' on 'Window': Failed to parse URL from file://127.0.0.1:5001/api/...
see dist/ipfsapi.js:5837
Could we add a way to explicitly set this protocol option? It could be passed as an opt in the requestAPI or included as a param of IpfsAPI. The latter might be preferable for this scenario so not to require a protocol opt for every method.. maybe it could be IpfsAPI(host_or_multiaddr, port, opts)?