diff --git a/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeApplicationBuilderExtensions.cs b/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeApplicationBuilderExtensions.cs index e395cf579d..1f06a818d6 100644 --- a/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeApplicationBuilderExtensions.cs +++ b/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeApplicationBuilderExtensions.cs @@ -5,14 +5,14 @@ namespace Umbraco.Web.BackOffice.AspNetCore { public static class UmbracoBackOfficeApplicationBuilderExtensions { - public static IApplicationBuilder UseUmbracoBackOffice(this IApplicationBuilder builder) + public static IApplicationBuilder UseUmbracoBackOffice(this IApplicationBuilder app) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseMiddleware(); + return app; } } } diff --git a/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeMiddleware.cs b/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeMiddleware.cs deleted file mode 100644 index 89d12718b5..0000000000 --- a/src/Umbraco.Web.BackOffice/AspNetCore/UmbracoBackOfficeMiddleware.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; - -namespace Umbraco.Web.BackOffice.AspNetCore -{ - public class UmbracoBackOfficeMiddleware - { - private readonly RequestDelegate _next; - public UmbracoBackOfficeMiddleware(RequestDelegate next) - { - _next = next; - } - - public async Task InvokeAsync(HttpContext context) - { - - // Call the next delegate/middleware in the pipeline - await _next(context); - } - } -} diff --git a/src/Umbraco.Web.UI.NetCore/Program.cs b/src/Umbraco.Web.UI.NetCore/Program.cs index 736649bb51..21eb1b6585 100644 --- a/src/Umbraco.Web.UI.NetCore/Program.cs +++ b/src/Umbraco.Web.UI.NetCore/Program.cs @@ -13,7 +13,9 @@ namespace Umbraco.Web.UI.BackOffice { public static void Main(string[] args) { - CreateHostBuilder(args).Build().Run(); + CreateHostBuilder(args) + .Build() + .Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => diff --git a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj index 946e97de00..69d223bcc6 100644 --- a/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj +++ b/src/Umbraco.Web.UI.NetCore/Umbraco.Web.UI.NetCore.csproj @@ -10,4 +10,8 @@ + + + + diff --git a/src/Umbraco.Web.UI.NetCore/wwwroot/favicon.ico b/src/Umbraco.Web.UI.NetCore/wwwroot/favicon.ico new file mode 100644 index 0000000000..a3a799985c Binary files /dev/null and b/src/Umbraco.Web.UI.NetCore/wwwroot/favicon.ico differ diff --git a/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteApplicationBuilderExtensions.cs b/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteApplicationBuilderExtensions.cs index 15f136bd6d..0fa911da00 100644 --- a/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteApplicationBuilderExtensions.cs +++ b/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteApplicationBuilderExtensions.cs @@ -1,18 +1,24 @@ using System; using Microsoft.AspNetCore.Builder; +using SixLabors.ImageSharp.Web.DependencyInjection; namespace Umbraco.Web.Website.AspNetCore { public static class UmbracoBackOfficeApplicationBuilderExtensions { - public static IApplicationBuilder UseUmbracoWebsite(this IApplicationBuilder builder) + public static IApplicationBuilder UseUmbracoWebsite(this IApplicationBuilder app) { - if (builder == null) + if (app == null) { - throw new ArgumentNullException(nameof(builder)); + throw new ArgumentNullException(nameof(app)); } - return builder.UseMiddleware(); + + // Important we handle image manipulations before the static files, otherwise the querystring is just ignored. + app.UseImageSharp(); + app.UseStaticFiles(); + + return app; } } } diff --git a/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteMiddleware.cs b/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteMiddleware.cs deleted file mode 100644 index b33f647dd2..0000000000 --- a/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteMiddleware.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; - -namespace Umbraco.Web.Website.AspNetCore -{ - public class UmbracoWebsiteMiddleware - { - private readonly RequestDelegate _next; - public UmbracoWebsiteMiddleware(RequestDelegate next) - { - _next = next; - } - - public async Task InvokeAsync(HttpContext context) - { - - // Call the next delegate/middleware in the pipeline - await _next(context); - } - } -} diff --git a/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteServiceCollectionExtensions.cs b/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteServiceCollectionExtensions.cs index fc689962a1..5fb2825269 100644 --- a/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteServiceCollectionExtensions.cs +++ b/src/Umbraco.Web.Website/AspNetCore/UmbracoWebsiteServiceCollectionExtensions.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.DependencyInjection; +using SixLabors.ImageSharp.Web.DependencyInjection; namespace Umbraco.Web.Website.AspNetCore { @@ -6,6 +7,9 @@ namespace Umbraco.Web.Website.AspNetCore { public static IServiceCollection AddUmbracoWebsite(this IServiceCollection services) { + services.AddImageSharp(); + + return services; } diff --git a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj index 55e6b06a87..e0d7f2eb6a 100644 --- a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj +++ b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj @@ -10,4 +10,8 @@ + + + +