修改续传key的构建,修改删除续传信息时失败的bug,添加测试

This commit is contained in:
Jackson.Bruce
2020-12-21 16:34:48 +08:00
parent 9c315f73f4
commit 18517b5e3b
6 changed files with 50 additions and 20 deletions

View File

@@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
@@ -36,7 +37,7 @@ namespace Ufangx.FileServices.Caching
throw new ArgumentException("message", nameof(fileName));
}
string cleanKey = $"StoreName={storeName}&FileName={fileName}&FileType={fileType}&FileSize={fileSize}&BlobSize={blobSize}&BlobCount={blobCount}&user={contextAccessor?.HttpContext?.User?.Identity?.Name}";
string cleanKey = $"StoreName={Path.GetDirectoryName(storeName).Replace('\\','/').ToLower()}&FileName={fileName.ToLower()}&FileType={fileType?.ToLower()}&FileSize={fileSize}&BlobSize={blobSize}&BlobCount={blobCount}&user={contextAccessor?.HttpContext?.User?.Identity?.Name?.ToLower()}";
byte[] data;
using (var md5 = MD5.Create())
{

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp2.0;netstandard2.1;netcoreapp3.0</TargetFrameworks>
@@ -13,7 +13,7 @@
<RepositoryType>git</RepositoryType>
<PackageTags>file service web uploader html5 uploader breakpoint renewal</PackageTags>
<Copyright>Copyright (c) 2020-$([System.DateTime]::Now.Year) Jackson.Bruce</Copyright>
<Version>1.0.0-beta.1</Version>
<Version>1.0.2-beta</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)|$(Platform)'=='netstandard2.0|AnyCPU'">

View File

@@ -19,7 +19,7 @@ namespace Ufangx.FileServices.Middlewares
}
protected override async Task Handler(HttpContext context)
{
string key = context.Request.Form["key"];
string key = context.Request.Query["key"];
var service= context.RequestServices.GetRequiredService<IResumableService>();
await WriteJsonAsync(context, await service.DeleteBlobs(key));
}