mirror of
https://github.com/Readarr/Readarr
synced 2026-01-28 10:24:44 +01:00
New: Only add version header for API requests
(cherry picked from commit 453891e620459ff38f7bc43b207004b240fc5fb8)
This commit is contained in:
parent
817ea75288
commit
63506e5a72
1 changed files with 2 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using NzbDrone.Common.EnvironmentInfo;
|
||||
using Readarr.Http.Extensions;
|
||||
|
||||
namespace Readarr.Http.Middleware
|
||||
{
|
||||
|
|
@ -19,7 +20,7 @@ public VersionMiddleware(RequestDelegate next)
|
|||
|
||||
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…
Reference in a new issue