mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.56 to 7.0.58 (#1928)
This commit is contained in:
24
vendor/github.com/minio/minio-go/v7/functional_tests.go
generated
vendored
24
vendor/github.com/minio/minio-go/v7/functional_tests.go
generated
vendored
@ -4821,6 +4821,11 @@ func testPresignedPostPolicy() {
|
||||
policy.SetContentType("binary/octet-stream")
|
||||
policy.SetContentLengthRange(10, 1024*1024)
|
||||
policy.SetUserMetadata(metadataKey, metadataValue)
|
||||
|
||||
// Add CRC32C
|
||||
checksum := minio.ChecksumCRC32C.ChecksumBytes(buf)
|
||||
policy.SetChecksum(checksum)
|
||||
|
||||
args["policy"] = policy.String()
|
||||
|
||||
presignedPostPolicyURL, formData, err := c.PresignedPostPolicy(context.Background(), policy)
|
||||
@ -4888,6 +4893,7 @@ func testPresignedPostPolicy() {
|
||||
Timeout: 30 * time.Second,
|
||||
Transport: transport,
|
||||
}
|
||||
args["url"] = presignedPostPolicyURL.String()
|
||||
|
||||
req, err := http.NewRequest(http.MethodPost, presignedPostPolicyURL.String(), bytes.NewReader(formBuf.Bytes()))
|
||||
if err != nil {
|
||||
@ -4920,13 +4926,21 @@ func testPresignedPostPolicy() {
|
||||
expectedLocation := scheme + os.Getenv(serverEndpoint) + "/" + bucketName + "/" + objectName
|
||||
expectedLocationBucketDNS := scheme + bucketName + "." + os.Getenv(serverEndpoint) + "/" + objectName
|
||||
|
||||
if val, ok := res.Header["Location"]; ok {
|
||||
if val[0] != expectedLocation && val[0] != expectedLocationBucketDNS {
|
||||
logError(testName, function, args, startTime, "", "Location in header response is incorrect", err)
|
||||
if !strings.Contains(expectedLocation, "s3.amazonaws.com/") {
|
||||
// Test when not against AWS S3.
|
||||
if val, ok := res.Header["Location"]; ok {
|
||||
if val[0] != expectedLocation && val[0] != expectedLocationBucketDNS {
|
||||
logError(testName, function, args, startTime, "", fmt.Sprintf("Location in header response is incorrect. Want %q or %q, got %q", expectedLocation, expectedLocationBucketDNS, val[0]), err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
logError(testName, function, args, startTime, "", "Location not found in header response", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
logError(testName, function, args, startTime, "", "Location not found in header response", err)
|
||||
}
|
||||
want := checksum.Encoded()
|
||||
if got := res.Header.Get("X-Amz-Checksum-Crc32c"); got != want {
|
||||
logError(testName, function, args, startTime, "", fmt.Sprintf("Want checksum %q, got %q", want, got), nil)
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user