diff --git a/fallback.go b/fallback.go index 94ec419..98bff26 100644 --- a/fallback.go +++ b/fallback.go @@ -14,12 +14,15 @@ type fallback struct { func OpenDefault(fb fallback, requestPath string) (http.File, error) { requestPath = path.Dir(requestPath) - defaultFile := requestPath + "/" + fb.defaultPath; + defaultFile := requestPath + fb.defaultPath; f, err := fb.fs.Open(defaultFile) if os.IsNotExist(err) && requestPath != "" { parentPath, _ := path.Split(requestPath) - return OpenDefault(fb, parentPath) + + if parentPath != requestPath { + return OpenDefault(fb, parentPath) + } } return f, err }