mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-08-03 10:38:40 +00:00
Log calculated hash when failing to uploading a new resource
This commit is contained in:
parent
954e2b3e7e
commit
23206b2a9b
1 changed files with 7 additions and 2 deletions
|
@ -70,9 +70,14 @@ namespace LBPUnion.ProjectLighthouse.Controllers
|
||||||
return this.UnprocessableEntity();
|
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();
|
return this.Conflict();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue