Ignore signRequest for Get() and GetPartial() if accesskeys are empty, missed from previous commit

This commit is contained in:
Harshavardhana
2015-04-23 14:27:57 -07:00
parent ef5b20dc2f
commit 45951e3f13
+6 -2
View File
@@ -99,7 +99,9 @@ func (c *s3Client) Get() (body io.ReadCloser, size int64, md5 string, err error)
if err != nil {
return nil, 0, "", iodine.New(err, nil)
}
c.signRequest(req, c.Host)
if c.AccessKeyID != "" && c.SecretAccessKey != "" {
c.signRequest(req, c.Host)
}
res, err := c.Transport.RoundTrip(req)
if err != nil {
return nil, 0, "", iodine.New(err, nil)
@@ -128,7 +130,9 @@ func (c *s3Client) GetPartial(offset, length int64) (body io.ReadCloser, size in
} else {
req.Header.Set("Range", fmt.Sprintf("bytes=%d-", offset))
}
c.signRequest(req, c.Host)
if c.AccessKeyID != "" && c.SecretAccessKey != "" {
c.signRequest(req, c.Host)
}
res, err := c.Transport.RoundTrip(req)
if err != nil {