mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
New: Only add version header for API requests
(cherry picked from commit 453891e620459ff38f7bc43b207004b240fc5fb8)
This commit is contained in:
parent
c3e44cc4ed
commit
bfb3c632d7
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Lidarr.Http.Extensions;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
|
||||||
|
@ -19,7 +20,7 @@ namespace Lidarr.Http.Middleware
|
||||||
|
|
||||||
public async Task InvokeAsync(HttpContext context)
|
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);
|
context.Response.Headers.Add(VERSIONHEADER, _version);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue