You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
res.sendfile seems to be decodeURIComponent-ing the path #1495
This is happening because visionmedia/send decodes the path before reading the file. I guess this is useful if the path comes as part of the URL (such as in the static() middleware which also uses the send module), but I don't know if it should be the default behavior of send. @visionmedia do you think that an option should be added to send so that it supports normal file paths (without URL encoding)? If so I can probably submit a pull request.
In the meantime, an option might be double encoding the path, so that http%3A%2F%2Ftoto.com.png would become http%253A%252F%252Ftoto.com.png.
Activity
jonathanong commentedon Sep 10, 2013
can you create a PR for a test? then we can see what we can do
sorribas commentedon Sep 11, 2013
This is happening because visionmedia/send decodes the path before reading the file. I guess this is useful if the path comes as part of the URL (such as in the
static()middleware which also uses the send module), but I don't know if it should be the default behavior of send. @visionmedia do you think that an option should be added to send so that it supports normal file paths (without URL encoding)? If so I can probably submit a pull request.In the meantime, an option might be double encoding the path, so that
http%3A%2F%2Ftoto.com.pngwould becomehttp%253A%252F%252Ftoto.com.png.tj commentedon Sep 11, 2013
bit of a weird edge-case IMO, especially since files don't have to be url-encoed they can be named
http://foo.comif you want tojonathanong commentedon Nov 30, 2013
moving to pillarjs/send#30