Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Remove miniprofiler (#464)
Krzysztof Pajak10a5064e6a0e
diff --git a/src/Core/Grand.Infrastructure/Configuration/PerformanceConfig.cs b/src/Core/Grand.Infrastructure/Configuration/PerformanceConfig.csindex 367fdcbec..846342909 100644--- a/src/Core/Grand.Infrastructure/Configuration/PerformanceConfig.cs+++ b/src/Core/Grand.Infrastructure/Configuration/PerformanceConfig.cs@@ -5,11 +5,6 @@ namespace Grand.Infrastructure.Configuration/// </summary>public partial class PerformanceConfig{- /// <summary>- /// Gets or sets a value indicating whether mini profiler should be displayed in public store (used for debugging)- /// </summary>- public bool DisplayMiniProfilerInPublicStore { get; set; }-/// <summary>/// Gets or sets a value indicating whether we compress response/// </summary>diff --git a/src/Plugins/Theme.Modern/Views/Modern/_ViewImports.cshtml b/src/Plugins/Theme.Modern/Views/Modern/_ViewImports.cshtmlindex 6b290b81f..916813e59 100644--- a/src/Plugins/Theme.Modern/Views/Modern/_ViewImports.cshtml+++ b/src/Plugins/Theme.Modern/Views/Modern/_ViewImports.cshtml@@ -3,7 +3,6 @@@removeTagHelper Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper, Microsoft.AspNetCore.Mvc.TagHelpers@addTagHelper *, Grand.Web.Common@addTagHelper *, Grand.Web-@addTagHelper *, MiniProfiler.AspNetCore.Mvc@using Microsoft.AspNetCore.Http.Extensions@using Microsoft.AspNetCore.Mvc.Localizationdiff --git a/src/Web/Grand.Web.Common/Grand.Web.Common.csproj b/src/Web/Grand.Web.Common/Grand.Web.Common.csprojindex ca6cbb028..849cc149c 100644--- a/src/Web/Grand.Web.Common/Grand.Web.Common.csproj+++ b/src/Web/Grand.Web.Common/Grand.Web.Common.csproj@@ -7,7 +7,6 @@<PackageReference Include="Flurl.Http" Version="4.0.0" /><PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.1" /><PackageReference Include="AspNetCore.HealthChecks.MongoDb" Version="8.0.0" />- <PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.3.8" /><PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.21.0" /><PackageReference Include="Wangkanai.Detection" Version="8.11.0" /><PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.1" />diff --git a/src/Web/Grand.Web.Common/Infrastructure/ApplicationBuilderExtensions.cs b/src/Web/Grand.Web.Common/Infrastructure/ApplicationBuilderExtensions.csindex 5eb5cc88c..f19977ec8 100644--- a/src/Web/Grand.Web.Common/Infrastructure/ApplicationBuilderExtensions.cs+++ b/src/Web/Grand.Web.Common/Infrastructure/ApplicationBuilderExtensions.cs@@ -1,5 +1,4 @@-using Grand.Domain.Common;-using Grand.Data;+using Grand.Data;using Grand.Infrastructure.Configuration;using Grand.Infrastructure.Endpoints;using Grand.Infrastructure.Plugins;@@ -11,7 +10,6 @@ using Microsoft.AspNetCore.Builder;using Microsoft.AspNetCore.Diagnostics;using Microsoft.AspNetCore.Hosting;using Microsoft.AspNetCore.Http;-using Microsoft.AspNetCore.Http.Extensions;using Microsoft.AspNetCore.HttpOverrides;using Microsoft.AspNetCore.StaticFiles;using Microsoft.Extensions.DependencyInjection;@@ -202,25 +200,7 @@ namespace Grand.Web.Common.Infrastructure});}-- /// <summary>- /// Create and configure MiniProfiler service- /// </summary>- /// <param name="application">Builder for configuring an application's request pipeline</param>- public static void UseProfiler(this IApplicationBuilder application)- {- //whether database is already installed- if (!DataSettingsManager.DatabaseIsInstalled())- return;-- var performanceConfig = application.ApplicationServices.GetRequiredService<PerformanceConfig>();- //whether MiniProfiler should be displayed- if (performanceConfig.DisplayMiniProfilerInPublicStore)- {- application.UseMiniProfiler();- }- }-+/// <summary>/// Configure UseForwardedHeaders/// </summary>diff --git a/src/Web/Grand.Web.Common/Infrastructure/ServiceCollectionExtensions.cs b/src/Web/Grand.Web.Common/Infrastructure/ServiceCollectionExtensions.csindex 73504efc4..7758c75f7 100644--- a/src/Web/Grand.Web.Common/Infrastructure/ServiceCollectionExtensions.cs+++ b/src/Web/Grand.Web.Common/Infrastructure/ServiceCollectionExtensions.cs@@ -2,9 +2,7 @@using FluentValidation;using Grand.Business.Core.Interfaces.Authentication;using Grand.Business.Core.Interfaces.Common.Configuration;-using Grand.Business.Core.Interfaces.Common.Security;using Grand.Business.Core.Utilities.Authentication;-using Grand.Business.Core.Utilities.Common.Security;using Grand.Domain.Configuration;using Grand.Data;using Grand.Infrastructure;@@ -261,32 +259,6 @@ namespace Grand.Web.Common.Infrastructurereturn mvcBuilder;}- /// <summary>- /// Add mini profiler service for the application- /// </summary>- /// <param name="services">Collection of service descriptors</param>- public static void AddGrandMiniProfiler(this IServiceCollection services)- {- //whether database is already installed- if (!DataSettingsManager.DatabaseIsInstalled())- return;-- //add MiniProfiler services- services.AddMiniProfiler(options =>- {- options.IgnoredPaths.Add("/api");- options.IgnoredPaths.Add("/odata");- options.IgnoredPaths.Add("/health/live");- options.IgnoredPaths.Add("/.well-known/pki-validation");- //determine who can access the MiniProfiler results- options.ResultsAuthorize = request =>- !request.HttpContext.RequestServices.GetRequiredService<PerformanceConfig>()- .DisplayMiniProfilerInPublicStore ||- request.HttpContext.RequestServices.GetRequiredService<IPermissionService>()- .Authorize(StandardPermission.ManageAccessAdminPanel).Result;- });- }-public static void AddSettings(this IServiceCollection services){var typeSearcher = new TypeSearcher();diff --git a/src/Web/Grand.Web.Common/Startup/GrandMvcStartup.cs b/src/Web/Grand.Web.Common/Startup/GrandMvcStartup.csindex 48b819fd1..2ca00cb21 100644--- a/src/Web/Grand.Web.Common/Startup/GrandMvcStartup.cs+++ b/src/Web/Grand.Web.Common/Startup/GrandMvcStartup.cs@@ -22,9 +22,6 @@ namespace Grand.Web.Common.Startup//add healthChecksservices.AddGrandHealthChecks();- //add miniprofiler- services.AddGrandMiniProfiler();-//add ApplicationInsightsservices.AddGrandApplicationInsights(configuration);@@ -40,9 +37,6 @@ namespace Grand.Web.Common.Startup/// <param name="webHostEnvironment">WebHostEnvironment</param>public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment){- //add MiniProfiler- application.UseProfiler();-//endpoint routingapplication.UseGrandEndpoints();}diff --git a/src/Web/Grand.Web/App_Data/appsettings.json b/src/Web/Grand.Web/App_Data/appsettings.jsonindex c8031fa08..2796766fe 100644--- a/src/Web/Grand.Web/App_Data/appsettings.json+++ b/src/Web/Grand.Web/App_Data/appsettings.json@@ -132,9 +132,6 @@//You may want to disable it, for example, If you have an active IIS Dynamic Compression Module configured at the server level"UseResponseCompression": false,- //Gets or sets a value indicating whether mini profiler should be displayed in public store (used for debugging)- "DisplayMiniProfilerInPublicStore": false,-//Indicates whether to ignore InstallUrlMiddleware"IgnoreInstallUrlMiddleware": false,diff --git a/src/Web/Grand.Web/Views/Shared/_Layout.cshtml b/src/Web/Grand.Web/Views/Shared/_Layout.cshtmlindex 571c4f8d1..6e2c8cdd7 100644--- a/src/Web/Grand.Web/Views/Shared/_Layout.cshtml+++ b/src/Web/Grand.Web/Views/Shared/_Layout.cshtml@@ -1,6 +1,4 @@-@using Grand.Infrastructure.Configuration-@inject PerformanceConfig config-<!DOCTYPE html>+<!DOCTYPE html><html use-lang="true"><head><title asp-default-title="true"></title>@@ -16,10 +14,6 @@<canonical-urls>@*Favicon - upload favicon.ico file to the wwwroot directory*@<partial name="Partials/Favicons" />- @if (config.DisplayMiniProfilerInPublicStore)- {- <mini-profiler />- }<resources asp-type="HeadLink" /><resources asp-type="HeadScript" />@await RenderSectionAsync("head", required: false)diff --git a/src/Web/Grand.Web/Views/_ViewImports.cshtml b/src/Web/Grand.Web/Views/_ViewImports.cshtmlindex ec961dabf..c7231095e 100644--- a/src/Web/Grand.Web/Views/_ViewImports.cshtml+++ b/src/Web/Grand.Web/Views/_ViewImports.cshtml@@ -3,7 +3,6 @@@removeTagHelper Microsoft.AspNetCore.Mvc.TagHelpers.InputTagHelper, Microsoft.AspNetCore.Mvc.TagHelpers@addTagHelper *, Grand.Web.Common@addTagHelper *, Grand.Web-@addTagHelper *, MiniProfiler.AspNetCore.Mvc@using System.Text;@using Microsoft.AspNetCore.Http.Extensions