lampac/BaseModule/Controllers/CubController.cs
lampac-talks f843f04fd4 chore: initial commit 154.3
Signed-off-by: lampac-talks <lampac-talks@users.noreply.github.com>
2026-01-30 16:23:09 +03:00

26 lines
836 B
C#

using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Shared;
using Shared.Engine;
using System.Web;
namespace Lampac.Controllers
{
public class CubController : BaseController
{
[HttpGet]
[AllowAnonymous]
[Route("cubproxy.js")]
[Route("cubproxy/js/{token}")]
public ActionResult CubProxy(string token)
{
if (!AppInit.conf.cub.enabled(requestInfo.Country))
return Content(string.Empty, contentType: "application/javascript; charset=utf-8");
string file = FileCache.ReadAllText("plugins/cubproxy.js").Replace("{localhost}", host);
file = file.Replace("{token}", HttpUtility.UrlEncode(token));
return Content(file, contentType: "application/javascript; charset=utf-8");
}
}
}