From 3ad673fa551de79e152f2787a80196308e438c54 Mon Sep 17 00:00:00 2001 From: "Gustavo L de Mello (Guz)" Date: Thu, 9 Jan 2025 11:06:31 -0300 Subject: [PATCH] fix(blogo): handle root directory request --- blogo/blogo.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blogo/blogo.go b/blogo/blogo.go index 12d8c55..068e329 100644 --- a/blogo/blogo.go +++ b/blogo/blogo.go @@ -95,6 +95,10 @@ func (b *Blogo) ServeHTTP(w http.ResponseWriter, r *http.Request) { } path := strings.Trim(r.URL.Path, "/") + if path == "" || path == "/" { + path = "." + } + f, err := b.files.Open(path) if errors.Is(err, fs.ErrNotExist) {