Эх сурвалжийг харах

Merge branch 'master' of http://git.12345lm.cn/Fengwo/hotline

Dun.Jason 1 жил өмнө
parent
commit
c09d0584e7

+ 3 - 2
src/Hotline.Api/Controllers/FileController.cs

@@ -8,6 +8,7 @@ using XF.Domain.Authentications;
 using XF.Domain.Exceptions;
 using XF.Domain.Repository;
 using Hotline.Caching.Interfaces;
+using Microsoft.AspNetCore.Authorization;
 
 namespace Hotline.Api.Controllers
 {
@@ -146,9 +147,9 @@ namespace Hotline.Api.Controllers
         public async Task<IActionResult> DownloadProxy([FromServices] IHttpClientFactory clientFactory, string path)
         {
             using var client = clientFactory.CreateClient();
-            using var responseMessage = await client.GetAsync(path, HttpContext.RequestAborted);
+            var responseMessage = await client.GetAsync(path, HttpContext.RequestAborted);
             responseMessage.EnsureSuccessStatusCode();
-            await using var stream = await responseMessage.Content.ReadAsStreamAsync(HttpContext.RequestAborted);
+            var stream = await responseMessage.Content.ReadAsStreamAsync(HttpContext.RequestAborted);
             return File(stream, responseMessage?.Content?.Headers?.ContentType?.MediaType);
         }
     }