[#93] Object ETag support

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2021-06-29 16:40:26 +03:00
parent b565045649
commit a6ec27b40d
6 changed files with 26 additions and 12 deletions

View file

@ -109,9 +109,10 @@ func fetchRangeHeader(headers http.Header, fullSize uint64) (*layer.RangeParams,
}
func writeHeaders(h http.Header, info *layer.ObjectInfo) {
h.Set("Content-Type", info.ContentType)
h.Set("Last-Modified", info.Created.Format(http.TimeFormat))
h.Set("Content-Length", strconv.FormatInt(info.Size, 10))
h.Set(api.ContentType, info.ContentType)
h.Set(api.LastModified, info.Created.Format(http.TimeFormat))
h.Set(api.ContentLength, strconv.FormatInt(info.Size, 10))
h.Set(api.ETag, info.HashSum)
for key, val := range info.Headers {
h.Set("X-"+key, val)