From 4d09475c290d85db1d1d1320a7e999a9fbe0e933 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Fri, 13 Nov 2020 20:11:55 +0200 Subject: [PATCH] fix https://github.com/kataras/iris/issues/1672 --- core/router/fs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/router/fs.go b/core/router/fs.go index 5cb6f6f7..182e197a 100644 --- a/core/router/fs.go +++ b/core/router/fs.go @@ -284,7 +284,7 @@ func FileServer(fs http.FileSystem, options DirOptions) context.Handler { // index requested, send a moved permanently status // and navigate back to the route without the index suffix. - if !noRedirect && strings.HasSuffix(name, options.IndexName) { + if !noRedirect && options.IndexName != "" && strings.HasSuffix(name, options.IndexName) { localRedirect(ctx, "./") return }