We have created a custom pipeline to append extra header details for PDFs. This works well on our local boxes however when we push the code to our UAT server hosted on Azure the pipeline is not called.
I have checked ShowConfig.aspx
and the patch config file has been added.
Aare there any other ways to work out why its not being called when we push it to Azure. Other custom pipelines in the project still work and we can't figure out why this one doesn't.
We also added logging however the log file is never populated, which tells me the class is never ran
An example of the class is as followed:
public class MediaRequestHeaderProcessor
{
public void Process(MediaRequestHeadersArgs args)
{
Assert.ArgumentNotNull(args, nameof(args));
var media = args.Media;
var headers = args.Context.Response.Headers;
if (Context.Database != null)
{
if (media != null)
{
var item = Context.Database.GetItem(media.MediaData.MediaItem.ID);
if (item != null)
{
headers.Add("X-Robots-Tag", "noindex");
}
}
}
}
}
Patch file:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<mediaRequestHeaders>
<processor type="Project.Feature.ResponseHeaders.Pipelines.MediaRequestHeaderProcessor, Project.Feature.ResponseHeaders" />
</mediaRequestHeaders>
</pipelines>
</sitecore>
</configuration>
On the Azure CM and CD server the patch file is present and so is the DLL. I've used dotPeek and the code in the DLL project matches my example above