mediaapi/writers/download: 500 ISE if disk and db file size differ
MODIFY
src/github.com/matrix-org/dendrite/mediaapi/writers/download.go
src/github.com/matrix-org/dendrite/mediaapi/writers/download.go
@@ -177,7 +177,10 @@ func (r *downloadRequest) respondFromLocalFile(w http.ResponseWriter, absBasePat
"fileSizeDatabase": r.MediaMetadata.FileSizeBytes,
"fileSizeDisk": stat.Size(),
}).Warn("File size in database and on-disk differ.")
- // FIXME: Remove erroneous file from database?
+ return &util.JSONResponse{
+ Code: 500,
+ JSON: jsonerror.InternalServerError(),
+ }
}
r.Logger.WithFields(log.Fields{

mediaapi/writers/download: 500 ISE if disk and db file size differ