Created
April 7, 2016 20:09
-
-
Save mursino/714de6a3d948837bfb098d44432c7316 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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