This PR addresses an issue raised in Discord that static files that contain spaces are not correctly served.
It turns out that for checking the existence of a file the uri is currently not unescaped.
The slightly unsatisfying part of this PR is that if the route is not a file, the unescaping is done twice; once for the file check and once in match_routes(). The alternative would be to change the req.target at the first entry point and then remove all unescaping at other places. But that sounds like being an overkill given the short amount of time for unescaping.
This PR addresses an issue raised in Discord that static files that contain spaces are not correctly served.
It turns out that for checking the existence of a file the uri is currently not unescaped.
The slightly unsatisfying part of this PR is that if the route is not a file, the unescaping is done twice; once for the file check and once in match_routes(). The alternative would be to change the req.target at the first entry point and then remove all unescaping at other places. But that sounds like being an overkill given the short amount of time for unescaping.