Merge pull request #1062 from notnoopci/no-empty-md5-header

Don't set empty ETag values
This commit is contained in:
Harshavardhana 2016-01-28 20:51:59 -08:00
commit 716fde3b93

View File

@ -79,7 +79,9 @@ func setObjectHeaders(w http.ResponseWriter, metadata fs.ObjectMetadata, content
lastModified := metadata.Created.Format(http.TimeFormat) lastModified := metadata.Created.Format(http.TimeFormat)
// object related headers // object related headers
w.Header().Set("Content-Type", "application/octet-stream") 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) w.Header().Set("Last-Modified", lastModified)
// set content range // set content range