From bd96d99a3aa3d53c31140415b0eff81e7ee92da9 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Wed, 31 May 2017 15:08:00 +0200 Subject: [PATCH] mediaapi/writers/download: 500 ISE if disk and db file size differ --- .../matrix-org/dendrite/mediaapi/writers/download.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go b/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go index 0df0c30c..c67e0a4e 100644 --- a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go +++ b/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{