-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serve files with no extension #43
Conversation
Sweeeet. I am very excited for this to get merged and deployed! |
details.relative = path.join(subPath, details.base) | ||
|
||
if (await isDir(filePath)) { | ||
details.base += '/' | ||
} else { | ||
details.ext = details.ext.split('.')[1] || 'txt' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the || 'txt'
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For files with no extension, details.ext.split('.')[1]
is undefined
. details.ext
is used here to add a class that determines which icon is used, and if it's undefined
, the class that renders the directory icon will apply.
Using anyrandomstring
instead of txt
would yield the same results, but I chose txt
in order to be consistent with how.txt
files are handled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for the explanation! I asked because it was confusing. 👍
Thanks a lot! 😊 |
I still cannot serve files without extensions. Im using version 11.0.2. Any Ideas? Here is what run in the terminal. |
Same, I feel like there might be a regression? |
I think this broke it: vercel/serve-handler@2b5d6a0 |
Fixes #25