mirror of
https://github.com/Readarr/Readarr
synced 2026-03-21 12:03:22 +01:00
24 lines
654 B
C#
24 lines
654 B
C#
using Nancy;
|
|
using Nancy.Bootstrapper;
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
namespace Readarr.Http.Extensions.Pipelines
|
|
{
|
|
public class ReadarrVersionPipeline : IRegisterNancyPipeline
|
|
{
|
|
public int Order => 0;
|
|
|
|
public void Register(IPipelines pipelines)
|
|
{
|
|
pipelines.AfterRequest.AddItemToStartOfPipeline(Handle);
|
|
}
|
|
|
|
private void Handle(NancyContext context)
|
|
{
|
|
if (!context.Response.Headers.ContainsKey("X-ApplicationVersion"))
|
|
{
|
|
context.Response.Headers.Add("X-ApplicationVersion", BuildInfo.Version.ToString());
|
|
}
|
|
}
|
|
}
|
|
}
|