I'm using Sitecore 9.0.2.
I am implementing Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions, that in Sitecore 9.0.2 has a constructor with the following signature:
public FilterUrlExtensions(string allowed, string blocked, string streamFiles, string doNotStreamFiles);
And my own class looks like this:
public class CustomPreprocessor : Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions
{
public CustomPreprocessor(string allowed, string blocked, string streamFiles, string doNotStreamFiles) : base(allowed, blocked, streamFiles, doNotStreamFiles)
{
}
public override void Process(PreprocessRequestArgs args)
{
base.Process(args);
}
}
Yet I'm still getting this error: Could not create instance of type: eSundhedWeb.Foundation.Permissions.Pipelines.CustomPreprocessor. No matching constructor was found.
What can be the cause for this?
The reason why I'm trying to override the preprocessor is because I serve media files they don't seem to enter into the HttpRequest pipeline where I'm doing some authentication. I read somewhere that the preprocessor might be sending it straight to MVC because media is served as .ashx. If you've got a better idea I'm grateful for clues.
EDIT: I'm registering the processor as such in a config file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<initialize>
<processor type="eSundhedWeb.Foundation.Permissions.Pipelines.CustomPreprocessor, eSundhedWeb.Foundation.Permissions" patch:instead="processor[@type='Sitecore.Pipelines.PreprocessRequest.FilterUrlExtensions, Sitecore.Kernel']" />
</initialize>
</pipelines>
</sitecore>
</configuration>