tide icon indicating copy to clipboard operation
tide copied to clipboard

serve_dir() does not automatically decode URL-encoded file paths

Open zelda-at-tempus opened this issue 5 years ago • 3 comments

I have an app that serves static files that have spaces in their names i.e. the file path would look like this on linux: /app/static/media/some name with spaces.txt

When my website requests the file from tide, it URL-encodes the path, changing spaces to %20 like so: http://localhost/static/media/some%20name%20with%20spaces.txt

The server doesn't treat these paths as the same.

I'm currently working around this by renaming files, but I wanted to know if this was expected behavior or not.

I imagine that this would cause filenames with certain symbols to also be unservable in the same way

zelda-at-tempus avatar Oct 27 '20 15:10 zelda-at-tempus

Thanks for filing this. Seems like a bug to me!

jbr avatar Oct 27 '20 15:10 jbr

I was looking at this issue but I don't think we url-decode anything in Tide anywhere right now? Not route parameters, not query parameters. Is this something we want to build in?

mendelt avatar Nov 09 '20 12:11 mendelt

I see this has been open since 2020. I don't know if anyone will read this comment, but it is still a problem. It means I have to implement serve_dir() myself. Is that the approach that others have taken?

Anglebrackets avatar May 26 '22 01:05 Anglebrackets