RangerMauve / hypercore-fetch

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

Entry names should not be URI-encoded in directory listings #62

Closed josephmturner closed 1 year ago

josephmturner commented 1 year ago

The items in the JSON object returned from GET hyper://PUBLIC-KEY/ should not be URI-encoded.

Currently, results look like ["path%20with%20spaces/"], instead of expected ["path with spaces/"].

josephmturner commented 1 year ago

I'm not sure how to test this, since https://github.com/RangerMauve/hypercore-fetch/blob/24131cad3edc29b51da519b79cca1072b62c2821/test.js#L85 passes, indicating that the string is not URI-encoded.

However, when I add a file to my local hyperdrive at a path containing special characters, the array that I get back from curl does contain URI-encoded strings. I.e., curl "http://localhost:4973/hyper/sw8dj5y9cs5nb8dzq1h9tbjt3b4u3sci6wfeckbsch9w3q7amipy/" returns ["path%20with%20spaces"].

RangerMauve commented 1 year ago

Mind posting your CURL request here as well as the request/response headers?

RangerMauve commented 1 year ago

My gut feeling is that cURL is doing some sort of extra encoding when you specify the space in the file name, but I'm not sure.

josephmturner commented 1 year ago

This was due to an issue in hyperdrive.el where we decoded the output of directory GET responses.