Skip to content

Instantly share code, notes, and snippets.

@mursino
Created April 7, 2016 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mursino/714de6a3d948837bfb098d44432c7316 to your computer and use it in GitHub Desktop.
Save mursino/714de6a3d948837bfb098d44432c7316 to your computer and use it in GitHub Desktop.
using Sitecore.Collections;
using Sitecore.Pipelines.HttpRequest;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Sitecore.PatchableIgnoreList
{
public class ProcessPatchedIgnores : HttpRequestProcessor
{
private List<string> _paths = new List<string>();
public override void Process(HttpRequestArgs args)
{
string filePath = args.Url.FilePath;
foreach (string path in _paths)
{
if (filePath.StartsWith(path, StringComparison.OrdinalIgnoreCase))
{
args.AbortPipeline();
return;
}
}
}
public void AddPaths(string path)
{
if (!string.IsNullOrEmpty(path) && !_paths.Contains(path))
{
_paths.Add(path);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment