RangerMauve / hypercore-fetch

Implementation of Fetch that uses the Hyper SDK for loading p2p content
MIT License
36 stars 12 forks source link

Should it be possible to put a file at the root url? #64

Closed josephmturner closed 1 year ago

josephmturner commented 1 year ago

Currently, it is possible to put a file at the root of a hyperdrive, so that hyper://PUBLIC-KEY points to a file (while hyper://PUBLIC-KEY/ points to the root directory). I think this is an extension of #40, but this specific case seems highly likely to confuse users.

RangerMauve commented 1 year ago

This should not be possible. Maybe it's taking the / as a file name?

RangerMauve commented 1 year ago

I'll just account for this and throw an error.

alphapapa commented 1 year ago

To be clear, this means that hyperdrive allows a filename to be the empty string?

RangerMauve commented 1 year ago

Seems so. I think they just take any arbitrary string as the name. Might be worthwhile to open an issue on the hyperdrive-next repo?

alphapapa commented 1 year ago

Yeah, it seems like allowing a filename to be the empty string is at least an oversight. I don't know of any other filesystems or HTTP servers that would allow that.

josephmturner commented 1 year ago

Seems so. I think they just take any arbitrary string as the name. Might be worthwhile to open an issue on the hyperdrive-next repo?

https://github.com/holepunchto/hyperdrive-next/issues/43

RangerMauve commented 1 year ago

I think we added some code to handle this case