filer: also honor request-level Content-Md5 in format ingest

This commit is contained in:
user.email committed 2026-10-24 09:54:32 -07:00
1 parent 19d7c0224b
commit b95b7f5761
1 file changed
+5 -1
+5 -1
View File
@@ -200,7 +200,11 @@ func (fs *FilerServer) formatIngest(ctx context.Context, w http.ResponseWriter,
writeJsonError(w, r, http.StatusInternalServerError, uploadErr)
return
}
if expectedMd5 := mediaPart.Header.Get("Content-Md5"); expectedMd5 != "" {
expectedMd5 := mediaPart.Header.Get("Content-Md5")
if expectedMd5 == "" {
expectedMd5 = r.Header.Get("Content-Md5")
}
if expectedMd5 != "" {
if md5bytes := md5Hash.Sum(nil); util.Base64Encode(md5bytes) != expectedMd5 && fmt.Sprintf("%x", md5bytes) != expectedMd5 {
cleanup()
writeJsonError(w, r, http.StatusBadRequest, errors.New(constants.ErrMsgBadDigest))