v14: Rewrite static assets for the backoffice (#14472)

* add extension method to rewrite requests meant for backoffice static assets

* add backoffice rewrites to application builder

* embed the umbraco hash into the static assets requested on the backoffice

* Added a IStaticFileHostGenerator so its possible to replace our logic

* add docs and ensure the path is uniform with single slashes

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
This commit is contained in:
Jacob Overgaard
2023-06-28 14:55:19 +02:00
committed by GitHub
parent 7265d5c3be
commit ddca33337b
7 changed files with 233 additions and 162 deletions

View File

@@ -20,6 +20,7 @@ using Umbraco.Cms.Web.BackOffice.Security;
using Umbraco.Cms.Web.BackOffice.Services;
using Umbraco.Cms.Web.BackOffice.SignalR;
using Umbraco.Cms.Web.BackOffice.Trees;
using Umbraco.Cms.Web.Common.Hosting;
namespace Umbraco.Extensions;
@@ -81,6 +82,7 @@ public static partial class UmbracoBuilderExtensions
public static IUmbracoBuilder AddBackOfficeCore(this IUmbracoBuilder builder)
{
builder.Services.AddUnique<IStaticFilePathGenerator, UmbracoStaticFilePathGenerator>();
builder.Services.AddSingleton<KeepAliveMiddleware>();
builder.Services.ConfigureOptions<ConfigureGlobalOptionsForKeepAliveMiddlware>();
builder.Services.AddSingleton<ServerVariablesParser>();