You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like skynet-js doesn't support downloading from a skylink with a path appended (!). Any given path will be chopped off. I want to fix this and use the skylink as given, preserving path elements and query parameters.
Additional path parameter
I also want to add an optional path parameter. The difference would be that skylink is used as-is while the path parameter we would URI-encode e.g. the user could have a filename containing ?. We can't URI-encode skylink because it might contain query parameters we don't want to encode (and it could already be encoded). The path parameter lets users be able to pass in their filenames and paths without worrying about encoding (which they shouldn't have to think about) or manually appending to their skylinks.
The path parameter should accept an array of path elements, each of which gets URI-encoded and joined to form the full path. We can't take a full path like dir1/dir2/foo because the / character itself gets URI-encoded.
Issue by m-cat
Wednesday Sep 09, 2020 at 11:03 GMT
Originally opened as NebulousLabs/skynet-docs#34
Skylink with path
It looks like skynet-js doesn't support downloading from a
skylink
with a path appended (!). Any given path will be chopped off. I want to fix this and use theskylink
as given, preserving path elements and query parameters.Additional path parameter
I also want to add an optional
path
parameter. The difference would be thatskylink
is used as-is while the path parameter we would URI-encode e.g. the user could have a filename containing?
. We can't URI-encodeskylink
because it might contain query parameters we don't want to encode (and it could already be encoded). Thepath
parameter lets users be able to pass in their filenames and paths without worrying about encoding (which they shouldn't have to think about) or manually appending to their skylinks.The
path
parameter should accept an array of path elements, each of which gets URI-encoded and joined to form the full path. We can't take a full path likedir1/dir2/foo
because the/
character itself gets URI-encoded.Checklist
The text was updated successfully, but these errors were encountered: