Skip to content
This repository was archived by the owner on Apr 16, 2021. It is now read-only.

Support skylinks with optional paths #34

@mrcnski

Description

@mrcnski

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 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.

Checklist

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions