Skip to content

Commit

Permalink
Allow application/octet-stream as a possible content-type (#999)
Browse files Browse the repository at this point in the history
Due to eventual consistency of S3, sometimes the content type
returned by Minio S3 gateway doesn't match the value expected by
tests. This PR updates the test to allow application/octet-stream
as a possible value in addition to the expected content-type.

Fixes #997
  • Loading branch information
nitisht authored and kannappanr committed Jun 21, 2018
1 parent da8058c commit 699c904
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions functional_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -1499,6 +1499,7 @@ func testFPutObject() {

// Perform FPutObject with no contentType provided (Expecting application/x-gtar)
args["objectName"] = objectName + "-GTar"
args["opts"] = minio.PutObjectOptions{}
n, err = c.FPutObject(bucketName, objectName+"-GTar", fName+".gtar", minio.PutObjectOptions{})
if err != nil {
logError(testName, function, args, startTime, "", "FPutObject failed", err)
Expand Down Expand Up @@ -1541,8 +1542,8 @@ func testFPutObject() {
logError(testName, function, args, startTime, "", "StatObject failed", err)
return
}
if rGTar.ContentType != "application/x-gtar" {
logError(testName, function, args, startTime, "", "ContentType does not match, expected application/x-gtar, got "+rGTar.ContentType, err)
if rGTar.ContentType != "application/x-gtar" && rGTar.ContentType != "application/octet-stream" {
logError(testName, function, args, startTime, "", "ContentType does not match, expected application/x-gtar or application/octet-stream, got "+rGTar.ContentType, err)
return
}

Expand Down

0 comments on commit 699c904

Please sign in to comment.