From 04efc677c6be8d7fd1d4b6014c6d42292e43413e Mon Sep 17 00:00:00 2001 From: Mike Barry Date: Fri, 9 Feb 2024 06:59:08 -0500 Subject: [PATCH] fix? --- pmtiles/bucket.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pmtiles/bucket.go b/pmtiles/bucket.go index 1a9b226..6dfde8f 100644 --- a/pmtiles/bucket.go +++ b/pmtiles/bucket.go @@ -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)