1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-25 22:21:28 +00:00

Merge pull request #3345 from dingyuanhong/develop

fix / can use dynamic directory
This commit is contained in:
astaxie 2018-10-23 13:43:45 +08:00 committed by GitHub
commit 706c086bc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,7 +178,7 @@ func searchFile(ctx *context.Context) (string, os.FileInfo, error) {
if !strings.Contains(requestPath, prefix) { if !strings.Contains(requestPath, prefix) {
continue continue
} }
if len(requestPath) > len(prefix) && requestPath[len(prefix)] != '/' { if prefix != "/" && len(requestPath) > len(prefix) && requestPath[len(prefix)] != '/' {
continue continue
} }
filePath := path.Join(staticDir, requestPath[len(prefix):]) filePath := path.Join(staticDir, requestPath[len(prefix):])