New: Only add version header for API requests

(cherry picked from commit 453891e620459ff38f7bc43b207004b240fc5fb8)
pull/3621/head
Mark McDowall 1 year ago committed by Bogdan
parent c3e44cc4ed
commit bfb3c632d7

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using Lidarr.Http.Extensions;
using Microsoft.AspNetCore.Http;
using NzbDrone.Common.EnvironmentInfo;
@ -19,7 +20,7 @@ namespace Lidarr.Http.Middleware
public async Task InvokeAsync(HttpContext context)
{
if (!context.Response.Headers.ContainsKey(VERSIONHEADER))
if (context.Request.IsApiRequest() && !context.Response.Headers.ContainsKey(VERSIONHEADER))
{
context.Response.Headers.Add(VERSIONHEADER, _version);
}

Loading…
Cancel
Save