mirror of
https://github.com/makew0rld/amfora.git
synced 2024-09-11 05:55:27 +03:00
Show local directory index file if available (#319)
This commit is contained in:
parent
818604f582
commit
e35ba06cf9
@ -35,6 +35,12 @@ func handleFile(u string) (*structs.Page, bool) {
|
||||
if u[len(u)-1] != '/' {
|
||||
u += "/"
|
||||
}
|
||||
for _, index := range []string{"index.gmi", "index.gemini"} {
|
||||
m, err := os.Stat(uri.Path + "/" + index)
|
||||
if err == nil && !m.IsDir() {
|
||||
return handleFile(u + index)
|
||||
}
|
||||
}
|
||||
return createDirectoryListing(u)
|
||||
case mode.IsRegular():
|
||||
if fi.Size() > viper.GetInt64("a-general.page_max_size") {
|
||||
|
Loading…
Reference in New Issue
Block a user