mirror of
https://github.com/JogmansonReal/Radicade.git
synced 2026-10-25 23:18:56 -07:00
Radicade Public Code
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SixLabors.ImageSharp;
|
||||
|
||||
namespace RadicadeServer.CDN
|
||||
{
|
||||
[Route("cdn/invention/")]
|
||||
public class InventionCDN : Controller
|
||||
{
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Index() => Ok(new { status = "ok" });
|
||||
|
||||
[HttpGet("{datablob}")]
|
||||
public IActionResult GetDataBlob(string datablob)
|
||||
{
|
||||
if (!CdnStorageNames.IsServable(datablob)) return BadRequest();
|
||||
|
||||
var name = CdnStorageNames.Resolve(datablob);
|
||||
if (name == null) return NotFound();
|
||||
|
||||
CdnCaching.Apply(this, CdnCaching.ForBlob(name));
|
||||
|
||||
return PhysicalFile(Path.Join(DBConfig.CDNStorage, name), "application/octet-stream", enableRangeProcessing: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user