Merge pull request #615 from harshavardhana/pr_out_use_http_timeformat_to_return_s3_expects_us_to_return_in_gmt_not_utc

This commit is contained in:
Harshavardhana 2015-05-25 20:18:52 -07:00
commit 92a37e5113
2 changed files with 4 additions and 5 deletions

View File

@ -894,7 +894,7 @@ func (s *MySuite) TestDateFormat(c *C) {
func verifyHeaders(c *C, header http.Header, date time.Time, size int, contentType string, etag string) {
// Verify date
c.Assert(header.Get("Last-Modified"), Equals, date.Format(time.RFC1123))
c.Assert(header.Get("Last-Modified"), Equals, date.Format(http.TimeFormat))
// verify size
c.Assert(header.Get("Content-Length"), Equals, strconv.Itoa(size))
@ -903,7 +903,7 @@ func verifyHeaders(c *C, header http.Header, date time.Time, size int, contentTy
c.Assert(header.Get("Content-Type"), Equals, contentType)
// verify etag
c.Assert(header.Get("Etag"), Equals, etag)
c.Assert(header.Get("Etag"), Equals, "\""+etag+"\"")
}
func (s *MySuite) TestXMLNameNotInBucketListJson(c *C) {

View File

@ -22,7 +22,6 @@ import (
"encoding/xml"
"net/http"
"strconv"
"time"
"github.com/minio/minio/pkg/storage/drivers"
)
@ -64,11 +63,11 @@ func encodeErrorResponse(response interface{}, acceptsType contentType) []byte {
// Write object header
func setObjectHeaders(w http.ResponseWriter, metadata drivers.ObjectMetadata) {
lastModified := metadata.Created.Format(time.RFC1123)
lastModified := metadata.Created.Format(http.TimeFormat)
// common headers
setCommonHeaders(w, metadata.ContentType, int(metadata.Size))
// object related headers
w.Header().Set("ETag", metadata.Md5)
w.Header().Set("ETag", "\""+metadata.Md5+"\"")
w.Header().Set("Last-Modified", lastModified)
}