From 16d9fb3930f64d2347cc9f294469ef73b7f4ce79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Thierry=20K=C3=A9chichian?= Date: Fri, 4 Aug 2023 05:06:24 +0200 Subject: [PATCH] Use safer HeaderDictionaryExtensions (#14064) --- .../OrchardCore.Workflows/Http/Activities/HttpResponseTask.cs | 2 +- .../OrchardCore/Modules/ModularTenantContainerMiddleware.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Activities/HttpResponseTask.cs b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Activities/HttpResponseTask.cs index 16472d4e8fa..34ed0256239 100644 --- a/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Activities/HttpResponseTask.cs +++ b/src/OrchardCore.Modules/OrchardCore.Workflows/Http/Activities/HttpResponseTask.cs @@ -80,7 +80,7 @@ public override async Task ExecuteAsync(WorkflowExecuti foreach (var header in headers) { - response.Headers.Add(header); + response.Headers.Append(header.Key, header.Value); } if (!String.IsNullOrWhiteSpace(contentType)) diff --git a/src/OrchardCore/OrchardCore/Modules/ModularTenantContainerMiddleware.cs b/src/OrchardCore/OrchardCore/Modules/ModularTenantContainerMiddleware.cs index 6effb7d5e0d..cf07f1ee9af 100644 --- a/src/OrchardCore/OrchardCore/Modules/ModularTenantContainerMiddleware.cs +++ b/src/OrchardCore/OrchardCore/Modules/ModularTenantContainerMiddleware.cs @@ -37,7 +37,7 @@ public async Task Invoke(HttpContext httpContext) { if (shellSettings.IsInitializing()) { - httpContext.Response.Headers.Add(HeaderNames.RetryAfter, "10"); + httpContext.Response.Headers.Append(HeaderNames.RetryAfter, "10"); httpContext.Response.StatusCode = StatusCodes.Status503ServiceUnavailable; await httpContext.Response.WriteAsync("The requested tenant is currently initializing."); return;