Skip to content

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry committed Feb 9, 2024
1 parent ff4d5d1 commit 04efc67
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pmtiles/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,12 @@ func OpenBucket(ctx context.Context, bucketURL string, bucketPrefix string) (Buc
return bucket, nil
}
if strings.HasPrefix(bucketURL, "file") {
url, err := url.ParseRequestURI(bucketURL)
if err != nil {
return nil, err
fileprotocol := "file://"
if string(os.PathSeparator) != "/" {
fileprotocol += "/"
}
bucket := FileBucket{url.Path}
path := strings.Replace(bucketURL, fileprotocol, "", 1)
bucket := FileBucket{filepath.FromSlash(path)}
return bucket, nil
}
bucket, err := blob.OpenBucket(ctx, bucketURL)
Expand Down

0 comments on commit 04efc67

Please sign in to comment.