fix: windows tests for all cases (#9594)

Replaces #9299
This commit is contained in:
Klaus Post
2020-05-14 08:55:38 +02:00
committed by GitHub
parent 9c85928740
commit ee9077db7d
7 changed files with 74 additions and 44 deletions

View File

@@ -18,6 +18,8 @@ package cmd
import (
"context"
"runtime"
"strings"
"github.com/google/uuid"
"github.com/minio/minio-go/v6/pkg/s3utils"
@@ -50,6 +52,10 @@ func checkBucketAndObjectNames(ctx context.Context, bucket, object string) error
logger.LogIf(ctx, ObjectNameInvalid{Bucket: bucket, Object: object})
return ObjectNameInvalid{Bucket: bucket, Object: object}
}
if runtime.GOOS == globalWindowsOSName && strings.Contains(object, "\\") {
// Objects cannot be contain \ in Windows and is listed as `Characters to Avoid`.
return ObjectNameInvalid{Bucket: bucket, Object: object}
}
return nil
}