Local Fetcher: fix path detection

This commit is contained in:
wpetit 2020-04-07 08:43:18 +02:00
parent 4fb04e66bd
commit 49117d619a
1 changed files with 6 additions and 2 deletions

View File

@ -21,7 +21,11 @@ func (f *LocalFetcher) Match(url *url.URL) bool {
return true return true
} }
return isFilesystemPath(url.Path) if url.Scheme == "" && isFilesystemPath(url.Path) {
return true
}
return false
} }
func NewLocalFetcher() *LocalFetcher { func NewLocalFetcher() *LocalFetcher {
@ -29,5 +33,5 @@ func NewLocalFetcher() *LocalFetcher {
} }
func isFilesystemPath(path string) bool { func isFilesystemPath(path string) bool {
return strings.HasPrefix(path, "./") || strings.HasPrefix(path, "/") return strings.HasPrefix(path, ".") || strings.HasPrefix(path, "/")
} }