Open
Description
When using the gateway in directory listing mode, if you have a double slash in the path, the request won't find the folder or files.
I suggest removing extra slashes from the path using a rewrite, a map in the config or from JavaScript.
Example:
https://example.com/pathFoo//file.txt
would become https://example.com/pathFoo/file.txt
https://example.com/pathFoo//subpathFoo///
would become https://example.com/pathFoo/subpathFoo/
Metadata
Metadata
Assignees
Labels
No labels
Activity
dekobon commentedon Feb 10, 2023
In principle, I like this idea. How would you propose to deal with the unlikely edge case that someone names their object something silly like:
/file.txt
dav-pascual commentedon Feb 15, 2023
AFAIK it's illegal that files or folders have slashes in their name both in AWS and Linux.
See (in AWS console):

Nevertheless, I have managed to create a folder with slashes in its name using aws-cli:

But I would consider it erractic behaviour. If you wanted to contemplate this extreme edge case, we could have a config ENVVAR to disable the removal of slashes.
dekobon commentedon Feb 23, 2023
Hi @dav-pascual , I would very much welcome a PR that fixes this issue with a rewrite rule.