Merge db1c5bab13
into 72ed8fa4a9
This commit is contained in:
commit
b6d492d1f4
1 changed files with 5 additions and 2 deletions
|
@ -14,13 +14,16 @@ 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)
|
||||
|
||||
if parentPath != requestPath {
|
||||
return OpenDefault(fb, parentPath)
|
||||
}
|
||||
}
|
||||
return f, err
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue