1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

delete with etag

This commit is contained in:
Kyle Spearrin 2019-03-19 21:41:24 -04:00
parent c29ae6601f
commit 6d581c57fe

View File

@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Bit.Core.Models.Data;
using Microsoft.WindowsAzure.Storage;
@ -73,7 +74,18 @@ namespace Bit.Core.Repositories.TableStorage
public async Task DeleteAsync(InstallationDeviceEntity entity)
{
try
{
entity.ETag = "*";
await _table.ExecuteAsync(TableOperation.Delete(entity));
}
catch(StorageException e)
{
if(e.RequestInformation.HttpStatusCode != (int)HttpStatusCode.NotFound)
{
throw e;
}
}
}
}
}