aboutsummaryrefslogtreecommitdiff
path: root/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'handler.go')
-rw-r--r--handler.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/handler.go b/handler.go
index addc538..804c4b2 100644
--- a/handler.go
+++ b/handler.go
@@ -59,9 +59,11 @@ func (h Handler) getFilePath(rawURL string) (string, error) {
return itemPath, nil
}
- indexPath := filepath.Join(itemPath, "index.gmi")
- if isFile(indexPath) {
- return indexPath, nil
+ for _, indexFile := range h.cfg.IndexFiles {
+ indexPath := filepath.Join(itemPath, indexFile)
+ if isFile(indexPath) {
+ return indexPath, nil
+ }
}
return "", gemini.Error{Err: fmt.Errorf("file not found"), Status: gemini.StatusNotFound}