Closed dumyan closed 7 years ago
I think we just can't use //
in general purpose library for registy url and schemas urls because the library could be used from file://..
source breaking all our links. So it will be just incorrect way to write urls. (cc @pwalsh @rufuspollock)
@roll Since this is an issue only in the browser, one way we can approach it is to check if the user is running in browser and look up window.location.protocol
to see if we should prepend http
or https
to the path. If the user is running in node we can force https
. This way relative protocol (//
) can be also used in the descriptors or for initializing a datapackage. We need to make it clear that paths starting with //
will be interpreted as http
or https
though.
NOT ACTUAL for now we don't use relative protocol inside the codebase
Using relative protocol URLs (
//
) in node works, butisomorphic-fetch
throws the following error in the browser:One alternative is to use qubyte/fetch-ponyfill and another is to use github/whatwg-fetch for the browser and bitinn/node-fetch for node.