updated redirect to deliver the javascript files

This commit is contained in:
krut_ni 2026-07-08 21:44:11 +02:00
parent 31e4d7f828
commit fecd9c4869
No known key found for this signature in database
GPG Key ID: A5C0151B4DDB172C

View File

@ -4,11 +4,12 @@ internal static class Redirect
{ {
private const string CONTENT = "/_content/"; private const string CONTENT = "/_content/";
private const string SYSTEM = "/system/"; private const string SYSTEM = "/system/";
private const string CODE_EDITOR = "/system/CodeEditor/";
internal static async Task HandlerContentAsync(HttpContext context, Func<Task> nextHandler) internal static async Task HandlerContentAsync(HttpContext context, Func<Task> nextHandler)
{ {
var path = context.Request.Path.Value; var path = context.Request.Path.Value;
if(string.IsNullOrWhiteSpace(path)) if (string.IsNullOrWhiteSpace(path))
{ {
await nextHandler(); await nextHandler();
return; return;
@ -16,6 +17,12 @@ internal static class Redirect
#if DEBUG #if DEBUG
if (path.StartsWith(CODE_EDITOR, StringComparison.InvariantCulture))
{
await nextHandler();
return;
}
if (path.StartsWith(SYSTEM, StringComparison.InvariantCulture)) if (path.StartsWith(SYSTEM, StringComparison.InvariantCulture))
{ {
context.Response.Redirect(path.Replace(SYSTEM, CONTENT), true, true); context.Response.Redirect(path.Replace(SYSTEM, CONTENT), true, true);