|
|
|
@ -68,6 +68,13 @@ func encodeResponseJSON(response interface{}) []byte { |
|
|
|
|
return bytesBuffer.Bytes() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Write parts count
|
|
|
|
|
func setPartsCountHeaders(w http.ResponseWriter, objInfo ObjectInfo) { |
|
|
|
|
if strings.Contains(objInfo.ETag, "-") && len(objInfo.Parts) > 0 { |
|
|
|
|
w.Header()[xhttp.AmzMpPartsCount] = []string{strconv.Itoa(len(objInfo.Parts))} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Write object header
|
|
|
|
|
func setObjectHeaders(w http.ResponseWriter, objInfo ObjectInfo, rs *HTTPRangeSpec) (err error) { |
|
|
|
|
// set common headers
|
|
|
|
@ -82,10 +89,6 @@ func setObjectHeaders(w http.ResponseWriter, objInfo ObjectInfo, rs *HTTPRangeSp |
|
|
|
|
w.Header()[xhttp.ETag] = []string{"\"" + objInfo.ETag + "\""} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if strings.Contains(objInfo.ETag, "-") && len(objInfo.Parts) > 0 { |
|
|
|
|
w.Header()[xhttp.AmzMpPartsCount] = []string{strconv.Itoa(len(objInfo.Parts))} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if objInfo.ContentType != "" { |
|
|
|
|
w.Header().Set(xhttp.ContentType, objInfo.ContentType) |
|
|
|
|
} |
|
|
|
|