From 3abf0b69f2a61941b1dd970ce40c5ba0ed4a4831 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Fri, 17 Nov 2023 22:25:06 -0500 Subject: [PATCH] Do not increase request stack depth when just adding response headers --- .../Extensions/ApplicationBuilderExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs b/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs index 55086228dc..53d953afe5 100644 --- a/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs +++ b/src/Tgstation.Server.Host/Extensions/ApplicationBuilderExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Globalization; using System.Net; @@ -158,10 +158,10 @@ namespace Tgstation.Server.Host.Extensions ArgumentNullException.ThrowIfNull(applicationBuilder); ArgumentNullException.ThrowIfNull(assemblyInformationProvider); - applicationBuilder.Use(async (context, next) => + applicationBuilder.Use((context, next) => { context.Response.Headers.Add("X-Powered-By", assemblyInformationProvider.VersionPrefix); - await next(); + return next(); }); }