|
|
@ -19,6 +19,7 @@ package gcs |
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"context" |
|
|
|
"context" |
|
|
|
"encoding/base64" |
|
|
|
"encoding/base64" |
|
|
|
|
|
|
|
"encoding/hex" |
|
|
|
"encoding/json" |
|
|
|
"encoding/json" |
|
|
|
"errors" |
|
|
|
"errors" |
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
@ -830,12 +831,17 @@ func fromGCSAttrsToObjectInfo(attrs *storage.ObjectAttrs) minio.ObjectInfo { |
|
|
|
if attrs.ContentLanguage != "" { |
|
|
|
if attrs.ContentLanguage != "" { |
|
|
|
metadata["Content-Language"] = attrs.ContentLanguage |
|
|
|
metadata["Content-Language"] = attrs.ContentLanguage |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
etag := hex.EncodeToString(attrs.MD5) |
|
|
|
|
|
|
|
if etag == "" { |
|
|
|
|
|
|
|
etag = minio.ToS3ETag(fmt.Sprintf("%d", attrs.CRC32C)) |
|
|
|
|
|
|
|
} |
|
|
|
return minio.ObjectInfo{ |
|
|
|
return minio.ObjectInfo{ |
|
|
|
Name: attrs.Name, |
|
|
|
Name: attrs.Name, |
|
|
|
Bucket: attrs.Bucket, |
|
|
|
Bucket: attrs.Bucket, |
|
|
|
ModTime: attrs.Updated, |
|
|
|
ModTime: attrs.Updated, |
|
|
|
Size: attrs.Size, |
|
|
|
Size: attrs.Size, |
|
|
|
ETag: minio.ToS3ETag(fmt.Sprintf("%d", attrs.CRC32C)), |
|
|
|
ETag: etag, |
|
|
|
UserDefined: metadata, |
|
|
|
UserDefined: metadata, |
|
|
|
ContentType: attrs.ContentType, |
|
|
|
ContentType: attrs.ContentType, |
|
|
|
ContentEncoding: attrs.ContentEncoding, |
|
|
|
ContentEncoding: attrs.ContentEncoding, |
|
|
|