Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

azure metadata: skip metadata prefixed with "X-"

chrislu4193dafce128
diff --git a/weed/remote_storage/azure/azure_storage_client.go b/weed/remote_storage/azure/azure_storage_client.go
index 8f28661b56..ad2bbdacb8 100644
--- a/weed/remote_storage/azure/azure_storage_client.go
+++ b/weed/remote_storage/azure/azure_storage_client.go
@@ -7,6 +7,7 @@ import (
"net/url"
"os"
"reflect"
+ "strings"
"github.com/Azure/azure-storage-blob-go/azblob"
"github.com/seaweedfs/seaweedfs/weed/filer"
@@ -187,6 +188,9 @@ func (az *azureRemoteStorageClient) readFileRemoteEntry(loc *remote_pb.RemoteSto
func toMetadata(attributes map[string][]byte) map[string]string {
metadata := make(map[string]string)
for k, v := range attributes {
+ if strings.HasPrefix(k, "X-") {
+ continue
+ }
metadata[k] = string(v)
}
return metadata
diff --git a/weed/remote_storage/gcs/gcs_storage_client.go b/weed/remote_storage/gcs/gcs_storage_client.go
index baeb192d84..b048effd95 100644
--- a/weed/remote_storage/gcs/gcs_storage_client.go
+++ b/weed/remote_storage/gcs/gcs_storage_client.go
@@ -6,6 +6,7 @@ import (
"io"
"os"
"reflect"
+ "strings"
"cloud.google.com/go/storage"
"github.com/seaweedfs/seaweedfs/weed/glog"
@@ -166,6 +167,9 @@ func (gcs *gcsRemoteStorageClient) readFileRemoteEntry(loc *remote_pb.RemoteStor
func toMetadata(attributes map[string][]byte) map[string]string {
metadata := make(map[string]string)
for k, v := range attributes {
+ if strings.HasPrefix(k, "X-") {
+ continue
+ }
metadata[k] = string(v)
}
return metadata