|
|
|
@ -154,6 +154,17 @@ func servePath(c *tls.Conn, request *url.URL, serve *pathConfig) {
|
|
|
|
|
if root[len(root)-1] != '/' { |
|
|
|
|
root += "/" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if !serve.SymLinks { |
|
|
|
|
for i := range requestSplit[pathSlashes:] { |
|
|
|
|
info, err := os.Lstat(path.Join(root, strings.Join(requestSplit[pathSlashes:pathSlashes+i+1], "/"))) |
|
|
|
|
if err != nil || info.Mode()&os.ModeSymlink == os.ModeSymlink { |
|
|
|
|
writeStatus(c, statusTemporaryFailure) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
filePath = path.Join(root, resolvedPath) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|