From 1d5f82ac22499b762e82a68911c1d71bba0191fc Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Tue, 10 Dec 2024 06:35:34 +1100 Subject: [PATCH] remove redundant allocation in ProtectedResourceErrorResult --- .../Endpoints/Results/ProtectedResourceErrorResult.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/IdentityServer/Endpoints/Results/ProtectedResourceErrorResult.cs b/src/IdentityServer/Endpoints/Results/ProtectedResourceErrorResult.cs index b897fd7f2..ba73ef94f 100644 --- a/src/IdentityServer/Endpoints/Results/ProtectedResourceErrorResult.cs +++ b/src/IdentityServer/Endpoints/Results/ProtectedResourceErrorResult.cs @@ -62,12 +62,12 @@ public Task WriteHttpResponse(ProtectedResourceErrorResult result, HttpContext c var errorString = string.Format($"error=\"{error}\""); if (errorDescription.IsMissing()) { - context.Response.Headers.Append(HeaderNames.WWWAuthenticate, new StringValues(new[] { "Bearer realm=\"IdentityServer\"", errorString }).ToString()); + context.Response.Headers.Append(HeaderNames.WWWAuthenticate, new StringValues(new[] { "Bearer realm=\"IdentityServer\"", errorString })); } else { var errorDescriptionString = string.Format($"error_description=\"{errorDescription}\""); - context.Response.Headers.Append(HeaderNames.WWWAuthenticate, new StringValues(new[] { "Bearer realm=\"IdentityServer\"", errorString, errorDescriptionString }).ToString()); + context.Response.Headers.Append(HeaderNames.WWWAuthenticate, new StringValues(new[] { "Bearer realm=\"IdentityServer\"", errorString, errorDescriptionString })); } return Task.CompletedTask;