|
|
@ -1,6 +1,7 @@
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
|
|
|
|
using Prowlarr.Http.Extensions;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Prowlarr.Http.Middleware
|
|
|
|
namespace Prowlarr.Http.Middleware
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -19,7 +20,7 @@ namespace Prowlarr.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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|