In fresh 2.0 static file path components aren't decoded
felix-schindler opened this issue · 0 comments
felix-schindler commented
This is only a problem in Fresh 2.0. In version 1.x everything works as expected
Summary
The static file middleware is not functioning correctly because it fails to decode path components. This results in problems when accessing files and directories with names containing special characters or encoded elements.
Examples of problematic file and directory names include:
C#.svg
西安.avif
제주도
Steps to Reproduce
- Place files with these names in the static file directory.
- Configure the static file middleware to serve files from this directory.
- Attempt to access these files via their URLs.
/C%23.svg
/%E8%A5%BF%E5%AE%89.avif
/%EC%A0%9C%EC%A3%BC%EB%8F%84/sth.txt
Expected behaviour
The middleware should decode the URL-encoded path components and correctly serve the requested files:
/static/C#.svg
/static/西安.avif
/static/제주도/sth.txt
Actual Behavior
The middleware does not decode the path components, resulting in 404 errors.
Environment
- @fresh/core@2.0.0-alpha.19
- deno 1.45.5
- macos 14.6 (arm64)