refactor file server
This commit is contained in:
@@ -10,7 +10,6 @@ using MareSynchronosShared.Services;
|
||||
using MareSynchronosShared.Utils;
|
||||
using MareSynchronosStaticFilesServer.Services;
|
||||
using MareSynchronosStaticFilesServer.Utils;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.SignalR;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -165,18 +164,6 @@ public class ServerFilesController : ControllerBase
|
||||
return Ok(JsonSerializer.Serialize(notCoveredFiles.Values.ToList()));
|
||||
}
|
||||
|
||||
[HttpGet(MareFiles.ServerFiles_Get + "/{fileId}")]
|
||||
[Authorize(Policy = "Internal")]
|
||||
public IActionResult GetFile(string fileId)
|
||||
{
|
||||
_logger.LogInformation($"GetFile:{MareUser}:{fileId}");
|
||||
|
||||
var fs = _cachedFileProvider.GetLocalFileStream(fileId);
|
||||
if (fs == null) return NotFound();
|
||||
|
||||
return File(fs, "application/octet-stream");
|
||||
}
|
||||
|
||||
[HttpPost(MareFiles.ServerFiles_Upload + "/{hash}")]
|
||||
[RequestSizeLimit(200 * 1024 * 1024)]
|
||||
public async Task<IActionResult> UploadFile(string hash, CancellationToken requestAborted)
|
||||
|
||||
Reference in New Issue
Block a user