From 798e5d22ad7ff4a3a00460759ef1e3859c15d35e Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Sat, 24 Oct 2020 11:43:15 +0800 Subject: [PATCH] aggregate headers are case sensitive --- aspnet-core/LINGYUN.MicroService.sln | 2 +- .../Multiplexer/AbpApiDefinitionAggregator.cs | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/aspnet-core/LINGYUN.MicroService.sln b/aspnet-core/LINGYUN.MicroService.sln index b82d811e1..e01605823 100644 --- a/aspnet-core/LINGYUN.MicroService.sln +++ b/aspnet-core/LINGYUN.MicroService.sln @@ -249,7 +249,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManag EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PermissionManagement.Domain.Identity", "modules\identity\LINGYUN.Abp.PermissionManagement.Domain.Identity\LINGYUN.Abp.PermissionManagement.Domain.Identity.csproj", "{2D377D3A-70EC-4BB3-9F4C-6C933693DA98}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Account.Web", "modules\account\LINGYUN.Abp.Account.Web\LINGYUN.Abp.Account.Web.csproj", "{5F43141B-6C63-4547-B9D6-D69EC3D7CA7E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Account.Web", "modules\account\LINGYUN.Abp.Account.Web\LINGYUN.Abp.Account.Web.csproj", "{5F43141B-6C63-4547-B9D6-D69EC3D7CA7E}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Ocelot/Middleware/Multiplexer/AbpApiDefinitionAggregator.cs b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Ocelot/Middleware/Multiplexer/AbpApiDefinitionAggregator.cs index af72d9369..7910ccb4a 100644 --- a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Ocelot/Middleware/Multiplexer/AbpApiDefinitionAggregator.cs +++ b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/Ocelot/Middleware/Multiplexer/AbpApiDefinitionAggregator.cs @@ -20,9 +20,11 @@ namespace Ocelot.Middleware.Multiplexer protected virtual async Task MapAbpApiDefinitionAggregateContentAsync(List responses) { JObject responseObject = null; - JsonMergeSettings mergeSetting = new JsonMergeSettings(); - mergeSetting.MergeArrayHandling = MergeArrayHandling.Union; - mergeSetting.PropertyNameComparison = System.StringComparison.CurrentCultureIgnoreCase; + JsonMergeSettings mergeSetting = new JsonMergeSettings + { + MergeArrayHandling = MergeArrayHandling.Union, + PropertyNameComparison = System.StringComparison.CurrentCultureIgnoreCase + }; foreach (var httpResponse in responses) { var content = await httpResponse.Items.DownstreamResponse().Content.ReadAsStringAsync(); @@ -40,7 +42,7 @@ namespace Ocelot.Middleware.Multiplexer { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }; - stringContent.Headers.Add("_abperrorformat", "true"); + stringContent.Headers.Add("_AbpErrorFormat", "true"); return new DownstreamResponse(stringContent, HttpStatusCode.OK, new List>>(), "OK"); }