|
@@ -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);
|
|
|
}
|
|
|
}
|