diff --git a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxyScriptController.cs b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxyScriptController.cs index 3263075bad..99cada9602 100644 --- a/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxyScriptController.cs +++ b/framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxyScriptController.cs @@ -32,8 +32,13 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting model.Normalize(); var script = _proxyScriptManager.GetScript(model.CreateOptions()); - return Content(_options.MinifyGeneratedScript == true ? _javascriptMinifier.Minify(script) : script, - MimeTypes.Application.Javascript); + + return Content( + _options.MinifyGeneratedScript == true + ? _javascriptMinifier.Minify(script) + : script, + MimeTypes.Application.Javascript + ); } } } diff --git a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs index bd7366b931..c7dce93b3a 100644 --- a/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs +++ b/framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/ProxyScripting/AbpServiceProxiesController_Tests.cs @@ -1,4 +1,5 @@ using System.Threading.Tasks; +using Microsoft.Extensions.Options; using Shouldly; using Xunit; @@ -16,7 +17,10 @@ namespace Volo.Abp.AspNetCore.Mvc.ProxyScripting [Fact] public async Task GetAllWithMinify() { + GetRequiredService>().Value.MinifyGeneratedScript = false; var script = await GetResponseAsStringAsync("/Abp/ServiceProxyScript"); + + GetRequiredService>().Value.MinifyGeneratedScript = true; var minifyScript = await GetResponseAsStringAsync("/Abp/ServiceProxyScript?minify=true"); script.Length.ShouldBeGreaterThan(0);