MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / JoinBasePath

Function JoinBasePath

pkg/utils/path.go:81–88  ·  view source on GitHub ↗
(basePath, reqPath string)

Source from the content-addressed store, hash-verified

79}
80
81func JoinBasePath(basePath, reqPath string) (string, error) {
82 isRelativePath := strings.Contains(reqPath, "..")
83 reqPath = FixAndCleanPath(reqPath)
84 if isRelativePath && !strings.Contains(reqPath, "..") {
85 return "", errs.RelativePath
86 }
87 return stdpath.Join(FixAndCleanPath(basePath), reqPath), nil
88}
89
90func GetFullPath(mountPath, path string) string {
91 return stdpath.Join(GetActualMountPath(mountPath), path)

Callers 1

JoinPathMethod · 0.92

Calls 1

FixAndCleanPathFunction · 0.85

Tested by

no test coverage detected