Fix duplicate resource uploading (#382)

This commit is contained in:
Josh 2022-07-29 22:48:44 -05:00 committed by GitHub
parent 958ddfeab0
commit e937f4f7cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -75,7 +75,7 @@ public class ResourcesController : ControllerBase
FileHelper.EnsureDirectoryCreated(assetsDirectory);
// lbp treats code 409 as success and as an indicator that the file is already present
if (FileHelper.ResourceExists(hash)) this.Conflict();
if (FileHelper.ResourceExists(hash)) return this.Conflict();
Logger.Info($"Processing resource upload (hash: {hash})", LogArea.Resources);
LbpFile file = new(await readFromPipeReader(this.Request.BodyReader));