Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable stat operations for specific ranges #1846

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
3 changes: 0 additions & 3 deletions api-get-object.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ func (c *Client) GetObject(ctx context.Context, bucketName, objectName string, o
} else {
// First request is a Stat or Seek call.
// Only need to run a StatObject until an actual Read or ReadAt request comes through.

// Remove range header if already set, for stat Operations to get original file size.
delete(opts.headers, "Range")
harshavardhana marked this conversation as resolved.
Show resolved Hide resolved
objectInfo, err = c.StatObject(gctx, bucketName, objectName, StatObjectOptions(opts))
if err != nil {
resCh <- getResponse{
Expand Down
3 changes: 0 additions & 3 deletions api-put-object_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func Test_SSEHeaders(t *testing.T) {
c, err := New("s3.amazonaws.com", &Options{
Transport: rt,
})

if err != nil {
t.Error(err)
}
Expand Down Expand Up @@ -147,7 +146,6 @@ func Test_SSEHeaders(t *testing.T) {
uploadID: "upId",
sse: opts.ServerSideEncryption,
})

if err != nil {
t.Error(err)
}
Expand All @@ -167,5 +165,4 @@ func Test_SSEHeaders(t *testing.T) {
}
})
}

}
12 changes: 8 additions & 4 deletions functional_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -2471,7 +2471,8 @@ func testTrailingChecksums() {
PO minio.PutObjectOptions
}{
// Currently there is no way to override the checksum type.
{header: "x-amz-checksum-crc32c",
{
header: "x-amz-checksum-crc32c",
hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli)),
ChecksumCRC32C: "set",
PO: minio.PutObjectOptions{
Expand All @@ -2481,7 +2482,8 @@ func testTrailingChecksums() {
PartSize: 5 << 20,
},
},
{header: "x-amz-checksum-crc32c",
{
header: "x-amz-checksum-crc32c",
hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli)),
ChecksumCRC32C: "set",
PO: minio.PutObjectOptions{
Expand All @@ -2491,7 +2493,8 @@ func testTrailingChecksums() {
PartSize: 6_645_654, // Rather arbitrary size
},
},
{header: "x-amz-checksum-crc32c",
{
header: "x-amz-checksum-crc32c",
hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli)),
ChecksumCRC32C: "set",
PO: minio.PutObjectOptions{
Expand All @@ -2501,7 +2504,8 @@ func testTrailingChecksums() {
PartSize: 5 << 20,
},
},
{header: "x-amz-checksum-crc32c",
{
header: "x-amz-checksum-crc32c",
hasher: crc32.New(crc32.MakeTable(crc32.Castagnoli)),
ChecksumCRC32C: "set",
PO: minio.PutObjectOptions{
Expand Down