From 3961255f525b98bc50c441d9213cb4e6e6543f73 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Mon, 17 Oct 2016 21:40:16 +0200 Subject: [PATCH 1/2] avoid error with DNN cachebuster ver=xxx --- BuildScripts/ModulePackage.targets | 4 ++-- OpenImageProcessor.csproj | 31 ++++++++++++++++++++++++------ OpenImageProcessor.dnn | 8 ++++++-- ValidatingRequest.cs | 29 ++++++++++++++++++++++++++++ web.Debug.config | 30 +++++++++++++++++++++++++++++ web.Release.config | 31 ++++++++++++++++++++++++++++++ web.config | 15 +++++++++++++++ 7 files changed, 138 insertions(+), 10 deletions(-) create mode 100644 ValidatingRequest.cs create mode 100644 web.Debug.config create mode 100644 web.Release.config create mode 100644 web.config diff --git a/BuildScripts/ModulePackage.targets b/BuildScripts/ModulePackage.targets index 819463e..1fada5c 100644 --- a/BuildScripts/ModulePackage.targets +++ b/BuildScripts/ModulePackage.targets @@ -70,7 +70,7 @@ - + @@ -100,7 +100,7 @@ - + diff --git a/OpenImageProcessor.csproj b/OpenImageProcessor.csproj index 5177a68..26bc9cb 100644 --- a/OpenImageProcessor.csproj +++ b/OpenImageProcessor.csproj @@ -11,9 +11,9 @@ {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} Library Properties - Christoc.Modules.OpenImageProcessor - OpenImageProcessor - v4.0 + Satrabel.OpenImageProcessor + Satrabel.OpenImageProcessor + v4.5 true @@ -29,6 +29,7 @@ DEBUG;TRACE prompt 4 + false pdbonly @@ -37,15 +38,20 @@ TRACE prompt 4 + false - + False ..\..\bin\DotNetNuke.dll - + False - ..\..\bin\DotNetNuke.WebUtility.dll + ..\..\bin\DotNetNuke.Web.dll + + + False + ..\..\bin\ImageProcessor.Web.dll @@ -61,9 +67,11 @@ + + @@ -91,6 +99,17 @@ + + + + + + web.config + + + web.config + + 10.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) diff --git a/OpenImageProcessor.dnn b/OpenImageProcessor.dnn index 3f3cd2a..47b1392 100644 --- a/OpenImageProcessor.dnn +++ b/OpenImageProcessor.dnn @@ -1,6 +1,6 @@ - + OpenImageProcessor Satrabel OpenImageProcessor ~/Images/icon_extensions.gif @@ -17,7 +17,11 @@ - + + + Satrabel.OpenImageProcessor.dll + bin + ImageProcessor.dll bin diff --git a/ValidatingRequest.cs b/ValidatingRequest.cs new file mode 100644 index 0000000..fac77ca --- /dev/null +++ b/ValidatingRequest.cs @@ -0,0 +1,29 @@ +using DotNetNuke.Web.Api; +using ImageProcessor.Web.HttpModules; +using System; +using System.Collections.Generic; +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 cachebuster + if (queryCollection.AllKeys.Contains("ver")) + { + queryCollection.Remove("ver"); + args.QueryString = queryCollection.ToString(); + } + } + }; + } + } +} \ No newline at end of file diff --git a/web.Debug.config b/web.Debug.config new file mode 100644 index 0000000..2e302f9 --- /dev/null +++ b/web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/web.Release.config b/web.Release.config new file mode 100644 index 0000000..c358444 --- /dev/null +++ b/web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/web.config b/web.config new file mode 100644 index 0000000..b807387 --- /dev/null +++ b/web.config @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file From 4dad27f24091e0520d6e6154f77805fdaa069720 Mon Sep 17 00:00:00 2001 From: Sacha Trauwaen Date: Tue, 18 Oct 2016 19:29:01 +0200 Subject: [PATCH 2/2] remove ckeditor cachebuster --- ValidatingRequest.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ValidatingRequest.cs b/ValidatingRequest.cs index fac77ca..9a33c04 100644 --- a/ValidatingRequest.cs +++ b/ValidatingRequest.cs @@ -16,12 +16,17 @@ public void RegisterRoutes(IMapRoute mapRouteManager) if (!string.IsNullOrWhiteSpace(args.QueryString)) { var queryCollection = HttpUtility.ParseQueryString(args.QueryString); - // ignore cachebuster + // ignore DNN cachebuster if (queryCollection.AllKeys.Contains("ver")) { queryCollection.Remove("ver"); - args.QueryString = queryCollection.ToString(); } + // ignore ckeditor cachebuster + if (queryCollection.AllKeys.Contains("t")) + { + queryCollection.Remove("t"); + } + args.QueryString = queryCollection.ToString(); } }; }