mirror of
https://github.com/pgsty/minio.git
synced 2026-08-09 07:43:29 +03:00
convert ETag properly for all gateways (#5099)
Previously ID/ETag from backend service is used as is which causes failure on s3cmd like tools where those tools use ETag as checksum to validate data. This is fixed by prepending "-1". Refer minio/mint#193 minio/mint#201
This commit is contained in:
@@ -25,23 +25,6 @@ import (
|
||||
"github.com/Azure/azure-sdk-for-go/storage"
|
||||
)
|
||||
|
||||
// Test azureToS3ETag.
|
||||
func TestAzureToS3ETag(t *testing.T) {
|
||||
tests := []struct {
|
||||
etag string
|
||||
expected string
|
||||
}{
|
||||
{`"etag"`, `etag-1`},
|
||||
{"etag", "etag-1"},
|
||||
}
|
||||
for i, test := range tests {
|
||||
got := azureToS3ETag(test.etag)
|
||||
if got != test.expected {
|
||||
t.Errorf("test %d: got:%s expected:%s", i+1, got, test.expected)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Test canonical metadata.
|
||||
func TestS3MetaToAzureProperties(t *testing.T) {
|
||||
headers := map[string]string{
|
||||
|
||||
Reference in New Issue
Block a user