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
When the index is set to false, requests ending with / are being served with the content type header set to application/octet-stream instead of actual file's content type
#160
Closed
rmhaiderali opened this issue
Jan 17, 2024
· 5 comments
Windows intentionally implemented this behavior where, when accessing a path, if it ends with "/", instead of treating it as a directory, it checks if a file with the same name exists. In such cases, it ignores the "/" and allows users to access files as if the path did not end with "/".
I'm unsure about which package (serve-static or send) we should modify to include a check that restricts serving a file if its path ends with "/".
I will likely try to land that as the first minor release on send once we get express@5 out the door. I am going to close this and track this update in send since that is where the fix should be. @rmhaiderali if you would like to validate the fix there I would greatly appreciate it.
For example, when requesting /index.html/, the server is responding with a Content-Type header set to application/octet-stream instead of text/html.
index.js
public/index.html
The text was updated successfully, but these errors were encountered: