Use filepath.IsLocal over prefix check

This commit is contained in:
Pieter Noordhuis 2025-01-13 10:16:00 +01:00
parent 12943dbcff
commit aa9226446b
No known key found for this signature in database
GPG Key ID: 12ACCCC104CF2930
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ func (t *translateContext) rewritePath(
if err != nil {
return "", err
}
if strings.HasPrefix(localRelPath, "..") {
if !filepath.IsLocal(localRelPath) {
return "", fmt.Errorf("path %s is not contained in sync root path", localPath)
}