mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 16:52:04 +02:00
25 lines
710 B
C#
25 lines
710 B
C#
using System;
|
|
using Nancy;
|
|
using Nancy.Bootstrapper;
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
namespace NzbDrone.Api.Extensions.Pipelines
|
|
{
|
|
public class NzbDroneVersionPipeline : IRegisterNancyPipeline
|
|
{
|
|
public int Order { get { return 0; } }
|
|
|
|
public void Register(IPipelines pipelines)
|
|
{
|
|
pipelines.AfterRequest.AddItemToStartOfPipeline((Action<NancyContext>) Handle);
|
|
}
|
|
|
|
private void Handle(NancyContext context)
|
|
{
|
|
if (!context.Response.Headers.ContainsKey("X-ApplicationVersion"))
|
|
{
|
|
context.Response.Headers.Add("X-ApplicationVersion", BuildInfo.Version.ToString());
|
|
}
|
|
}
|
|
}
|
|
} |