-
Notifications
You must be signed in to change notification settings - Fork 3
/
ValidatingRequest.cs
39 lines (36 loc) · 1.3 KB
/
ValidatingRequest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using DotNetNuke.Web.Api;
using ImageProcessor.Web.HttpModules;
using System.Linq;
using System.Web;
namespace Satrabel.OpenImageProcessor
{
public class ValidatingRequest : IServiceRouteMapper
{
public void RegisterRoutes(IMapRoute mapRouteManager)
{
ImageProcessingModule.ValidatingRequest += (sender, args) =>
{
if (!string.IsNullOrWhiteSpace(args.QueryString))
{
var queryCollection = HttpUtility.ParseQueryString(args.QueryString);
// ignore DNN cachebuster
if (queryCollection.AllKeys.Contains("ver"))
{
queryCollection.Remove("ver");
}
// ignore ckeditor cachebuster
if (queryCollection.AllKeys.Contains("t"))
{
queryCollection.Remove("t");
}
// ignore DigitalAssets module cachebuster
if (queryCollection.AllKeys.Contains("timestamp"))
{
queryCollection.Remove("timestamp");
}
args.QueryString = queryCollection.ToString();
}
};
}
}
}