Unverified Commit 706c086b authored by astaxie's avatar astaxie Committed by GitHub

Merge pull request #3345 from dingyuanhong/develop

fix / can use dynamic directory
parents 5b8e468a dff9c8f5
...@@ -178,7 +178,7 @@ func searchFile(ctx *context.Context) (string, os.FileInfo, error) { ...@@ -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):])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment