1
0
mirror of https://github.com/makew0rld/amfora.git synced 2024-12-04 14:46:29 -05:00

🐛 Make sure file:// dir paths end in slash

This commit is contained in:
makeworld 2020-12-20 16:58:29 -05:00
parent 8ec9bb780c
commit 36455e800b

View File

@ -31,6 +31,10 @@ func handleFile(u string) (*structs.Page, bool) {
switch mode := fi.Mode(); {
case mode.IsDir():
// Must end in slash
if u[len(u)-1] != '/' {
u += "/"
}
return createDirectoryListing(u)
case mode.IsRegular():
if fi.Size() > viper.GetInt64("a-general.page_max_size") {