Relax strict ETag requirement for Get and Head requests

This commit is contained in:
Harshavardhana
2015-10-13 17:22:51 -07:00
parent 8f08a067c4
commit ee212e5b52
3 changed files with 4 additions and 68 deletions
-32
View File
@@ -494,14 +494,6 @@ func (a apiCore) putObjectUnAuthenticated(bucket, object, contentType string, si
}
var metadata ObjectStat
metadata.ETag = strings.Trim(resp.Header.Get("ETag"), "\"") // trim off the odd double quotes
if metadata.ETag == "" {
return ObjectStat{}, ErrorResponse{
Code: "InternalError",
Message: "Missing Etag, please report this issue at https://github.com/minio/minio-go-legacy/issues",
RequestID: resp.Header.Get("x-amz-request-id"),
HostID: resp.Header.Get("x-amz-id-2"),
}
}
return metadata, nil
}
@@ -545,14 +537,6 @@ func (a apiCore) putObject(bucket, object, contentType string, md5SumBytes []byt
}
var metadata ObjectStat
metadata.ETag = strings.Trim(resp.Header.Get("ETag"), "\"") // trim off the odd double quotes
if metadata.ETag == "" {
return ObjectStat{}, ErrorResponse{
Code: "InternalError",
Message: "Missing Etag, please report this issue at https://github.com/minio/minio-go-legacy/issues",
RequestID: resp.Header.Get("x-amz-request-id"),
HostID: resp.Header.Get("x-amz-id-2"),
}
}
return metadata, nil
}
@@ -669,14 +653,6 @@ func (a apiCore) getObject(bucket, object string, offset, length int64) (io.Read
}
}
md5sum := strings.Trim(resp.Header.Get("ETag"), "\"") // trim off the odd double quotes
if md5sum == "" {
return nil, ObjectStat{}, ErrorResponse{
Code: "InternalError",
Message: "Missing Etag, please report this issue at https://github.com/minio/minio-go-legacy/issues",
RequestID: resp.Header.Get("x-amz-request-id"),
HostID: resp.Header.Get("x-amz-id-2"),
}
}
date, err := time.Parse(http.TimeFormat, resp.Header.Get("Last-Modified"))
if err != nil {
return nil, ObjectStat{}, ErrorResponse{
@@ -824,14 +800,6 @@ func (a apiCore) headObject(bucket, object string) (ObjectStat, error) {
}
}
md5sum := strings.Trim(resp.Header.Get("ETag"), "\"") // trim off the odd double quotes
if md5sum == "" {
return ObjectStat{}, ErrorResponse{
Code: "InternalError",
Message: "Missing Etag, please report this issue at https://github.com/minio/minio-go-legacy/issues",
RequestID: resp.Header.Get("x-amz-request-id"),
HostID: resp.Header.Get("x-amz-id-2"),
}
}
size, err := strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 64)
if err != nil {
return ObjectStat{}, ErrorResponse{
-32
View File
@@ -494,14 +494,6 @@ func (a apiCore) putObjectUnAuthenticated(bucket, object, contentType string, si
}
var metadata ObjectStat
metadata.ETag = strings.Trim(resp.Header.Get("ETag"), "\"") // trim off the odd double quotes
if metadata.ETag == "" {
return ObjectStat{}, ErrorResponse{
Code: "InternalError",
Message: "Missing Etag, please report this issue at https://github.com/minio/minio-go/issues",
RequestID: resp.Header.Get("x-amz-request-id"),
HostID: resp.Header.Get("x-amz-id-2"),
}
}
return metadata, nil
}
@@ -545,14 +537,6 @@ func (a apiCore) putObject(bucket, object, contentType string, md5SumBytes []byt
}
var metadata ObjectStat
metadata.ETag = strings.Trim(resp.Header.Get("ETag"), "\"") // trim off the odd double quotes
if metadata.ETag == "" {
return ObjectStat{}, ErrorResponse{
Code: "InternalError",
Message: "Missing Etag, please report this issue at https://github.com/minio/minio-go/issues",
RequestID: resp.Header.Get("x-amz-request-id"),
HostID: resp.Header.Get("x-amz-id-2"),
}
}
return metadata, nil
}
@@ -672,14 +656,6 @@ func (a apiCore) getObject(bucket, object string, offset, length int64) (io.Read
}
}
md5sum := strings.Trim(resp.Header.Get("ETag"), "\"") // trim off the odd double quotes
if md5sum == "" {
return nil, ObjectStat{}, ErrorResponse{
Code: "InternalError",
Message: "Missing Etag, please report this issue at https://github.com/minio/minio-go/issues",
RequestID: resp.Header.Get("x-amz-request-id"),
HostID: resp.Header.Get("x-amz-id-2"),
}
}
date, err := time.Parse(http.TimeFormat, resp.Header.Get("Last-Modified"))
if err != nil {
return nil, ObjectStat{}, ErrorResponse{
@@ -827,14 +803,6 @@ func (a apiCore) headObject(bucket, object string) (ObjectStat, error) {
}
}
md5sum := strings.Trim(resp.Header.Get("ETag"), "\"") // trim off the odd double quotes
if md5sum == "" {
return ObjectStat{}, ErrorResponse{
Code: "InternalError",
Message: "Missing Etag, please report this issue at https://github.com/minio/minio-go/issues",
RequestID: resp.Header.Get("x-amz-request-id"),
HostID: resp.Header.Get("x-amz-id-2"),
}
}
size, err := strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 64)
if err != nil {
return ObjectStat{}, ErrorResponse{
+4 -4
View File
@@ -29,13 +29,13 @@
},
{
"path": "github.com/minio/minio-go",
"revision": "c031bbe3dd5e304e0f0bd154d97615fade8df23b",
"revisionTime": "2015-10-13T10:12:53-07:00"
"revision": "866c42f9e3ad89bf44f3527082a788166c385f5e",
"revisionTime": "2015-10-13T17:03:11-07:00"
},
{
"path": "github.com/minio/minio-go-legacy",
"revision": "49580a230a441dda8eedbf4440f15a4b3018a385",
"revisionTime": "2015-10-13T10:07:00-07:00"
"revision": "0e894de484c4e4ff39f36320b7153b7f57d395b9",
"revisionTime": "2015-10-13T17:08:05-07:00"
},
{
"path": "github.com/minio/minio/pkg/probe",