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

Created on 27 Oct 2020  路  2Comments  路  Source: http-rs/tide

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

bug

Most helpful comment

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

All 2 comments

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

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?

Was this page helpful?
0 / 5 - 0 ratings