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
+18
View File
@@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Mvc;
namespace RadicadeServer.CDN;
[Route("studiocdn")]
public class StudioAssetsCDN : Controller
{
[HttpGet("unityasset/{filename}"), HttpHead("unityasset/{filename}")]
[HttpGet("roomunityasset/{filename}"), HttpHead("roomunityasset/{filename}")]
public IActionResult Download(string filename)
{
if (string.IsNullOrEmpty(filename) || filename.Length > 80 ||
filename.Any(c => !char.IsAsciiLetterOrDigit(c) && c != '-')) return BadRequest();
var path = Path.GetFullPath(Path.Combine(DBConfig.CDNStorage, filename));
if (!System.IO.File.Exists(path)) return NotFound();
return PhysicalFile(path, "application/octet-stream", enableRangeProcessing: true);
}
}