-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gateway: URI-escaping of paths #2061
Comments
You'll have to escape # as %23 because it has a meaning in URLs. The actual request ends up as |
Oh I think I understand, the directory listing should be escaping these, but doesn't. Is that what you mean? |
Yes the directory listing in the browser doesn't escape them! |
Yep that's a bug, thank you |
Feel free to give it a try, the respective code is in |
Interestingly this link with @ _ and ~ in it will work without escaping for some reason Something funky going on |
No that looks totally fine to me -- the hash (#) within a path has the meaning of "fragment identifier", while @ doesn't have a meaning within a path. |
Ah, that makes sense! |
Ha, found another way how to confuse the web gateway
results:
|
we'll want to distill the solutions to these problems into a small doc that states clearly when to escape, and why. |
Yeah I suppose the lack of escaping works both ways :)
Agreed 👍 also, when not to escape |
https://en.wikipedia.org/wiki/Percent-encoding I have found so far 3 characters that break things and should be escaped
|
I created PR #2092 which should fix the issue. |
has been addressed long ago in ipfs/dir-index-html#9 |
For example, if file url's contain @ or # they don't work
https://ipfs.io/ipfs/QmZbfX4p7LUtuWgLtp1XYt6tkPnwfhqBTzqPDCanucYQrs/@#$_%5e_%20chillmix.mp3
will return
Path Resolve error: no link named "@" under QmZbfX4p7LUtuWgLtp1XYt6tkPnwfhqBTzqPDCanucYQrs
Or
https://ipfs.io/ipfs/QmZbfX4p7LUtuWgLtp1XYt6tkPnwfhqBTzqPDCanucYQrs/Cat%20D###%20Goo.mp3
will return
Path Resolve error: no link named "Cat D" under QmZbfX4p7LUtuWgLtp1XYt6tkPnwfhqBTzqPDCanucYQrs
Directory
https://ipfs.io/ipfs/QmZbfX4p7LUtuWgLtp1XYt6tkPnwfhqBTzqPDCanucYQrs/
Tested on chrome and firefox
The text was updated successfully, but these errors were encountered: