From 23206b2a9bff6716b25d5f5957e56ca535fbda7b Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 23 Nov 2021 17:03:33 -0500 Subject: [PATCH] Log calculated hash when failing to uploading a new resource --- ProjectLighthouse/Controllers/ResourcesController.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ProjectLighthouse/Controllers/ResourcesController.cs b/ProjectLighthouse/Controllers/ResourcesController.cs index 24949857..1a36395b 100644 --- a/ProjectLighthouse/Controllers/ResourcesController.cs +++ b/ProjectLighthouse/Controllers/ResourcesController.cs @@ -70,9 +70,14 @@ namespace LBPUnion.ProjectLighthouse.Controllers return this.UnprocessableEntity(); } - if (HashHelper.Sha1Hash(file.Data) != hash) + string calculatedHash = HashHelper.Sha1Hash(file.Data); + if (calculatedHash != hash) { - Logger.Log($"File hash does not match the uploaded file! (hash: {hash}, type: {file.FileType})", LoggerLevelResources.Instance); + Logger.Log + ( + $"File hash does not match the uploaded file! (hash: {hash}, calculatedHash: {calculatedHash}, type: {file.FileType})", + LoggerLevelResources.Instance + ); return this.Conflict(); }