Radicade Public Code

This commit is contained in:
JogmansonReal
2026-10-16 23:33:13 -07:00
commit 55175acdf6
832 changed files with 363261 additions and 0 deletions
+27
View File
@@ -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);
}
}
}