Don't set empty ETag values

Currently, metadata.Md5 value isn't populated, yet the ETag is set to
`""`, causing AWS Java SDK to fail integrity checks with GetObject
api calls.
master
Mahmood Ali 9 years ago
parent 52f00042b4
commit 43685788ab
  1. 4
      api-headers.go

@ -79,7 +79,9 @@ func setObjectHeaders(w http.ResponseWriter, metadata fs.ObjectMetadata, content
lastModified := metadata.Created.Format(http.TimeFormat)
// object related headers
w.Header().Set("Content-Type", "application/octet-stream")
w.Header().Set("ETag", "\""+metadata.Md5+"\"")
if metadata.Md5 != "" {
w.Header().Set("ETag", "\""+metadata.Md5+"\"")
}
w.Header().Set("Last-Modified", lastModified)
// set content range

Loading…
Cancel
Save