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
When a unixfs symlink is hit, if the mode is file (not block or car), gateway should emulate nginx and apache, that means resolve the symlink server side and return whatever file is being pointed to.
This proposal only targets relative symlinks (I have no idea what should happen with absolute ones).
To resolve it mean, take the current base path (the path of the folder containing the symlink).
Add the symlink path, do a lexical simplification (remove a/.. and . entries), and repeat the usual gateway process at that point.
Gateway MUST error if the lexical simplification errors (such as by a symlink having more .. than how deep it is in the dag).
Gateway MUST support recursively doing that (symlinks pointing to other symlinks). It MUST support a depth of at least 32, and SHOULD raise an error if number gets too big.
For example take this tree:
CID
+ a
| +- symlink (../b/example)
+ b
+- example
Loading CID/a/symlink the gateway would need to send the content of CID/b/example.
Because
First it resolve /a/symlink see that it's a symlink applies the content to the base path /a/../b/example
And then do a lexical simplification /b/example and then send this path content.
The text was updated successfully, but these errors were encountered:
When a unixfs symlink is hit, if the mode is file (not block or car), gateway should emulate nginx and apache, that means resolve the symlink server side and return whatever file is being pointed to.
This proposal only targets relative symlinks (I have no idea what should happen with absolute ones).
To resolve it mean, take the current base path (the path of the folder containing the symlink).
Add the symlink path, do a lexical simplification (remove
a/..
and.
entries), and repeat the usual gateway process at that point.Gateway MUST error if the lexical simplification errors (such as by a symlink having more
..
than how deep it is in the dag).Gateway MUST support recursively doing that (symlinks pointing to other symlinks). It MUST support a depth of at least 32, and SHOULD raise an error if number gets too big.
For example take this tree:
Loading
CID/a/symlink
the gateway would need to send the content ofCID/b/example
.Because
First it resolve
/a/symlink
see that it's a symlink applies the content to the base path/a/../b/example
And then do a lexical simplification
/b/example
and then send this path content.The text was updated successfully, but these errors were encountered: