diff --git a/CHANGELOG.md b/CHANGELOG.md index cec0a9f..8c75e6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) +## [3.1.1] - 2019-07-03 +### Fixed +- customBlockUrl redirect flow +- customBlockUrl whitelisting + ## [3.1.0] - 2019-06-05 ### Added - Send telemetry on demand by header diff --git a/PerimeterXModule/Properties/AssemblyInfo.cs b/PerimeterXModule/Properties/AssemblyInfo.cs index 7c01819..05a4303 100644 --- a/PerimeterXModule/Properties/AssemblyInfo.cs +++ b/PerimeterXModule/Properties/AssemblyInfo.cs @@ -23,5 +23,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.1.0")] -[assembly: AssemblyFileVersion("3.1.0")] +[assembly: AssemblyVersion("3.1.1")] +[assembly: AssemblyFileVersion("3.1.1")] diff --git a/PerimeterXModule/PxModule.cs b/PerimeterXModule/PxModule.cs index 0b7da60..d5604ff 100644 --- a/PerimeterXModule/PxModule.cs +++ b/PerimeterXModule/PxModule.cs @@ -68,6 +68,7 @@ public class PxModule : IHttpModule private readonly StringCollection useragentsWhitelist; private readonly StringCollection enforceSpecificRoutes; private readonly string cookieKey; + private readonly string customBlockUrl; private readonly byte[] cookieKeyBytes; private readonly string osVersion; private string nodeName; @@ -219,7 +220,7 @@ private void Application_BeginRequest(object source, EventArgs e) BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.IgnoreCase | BindingFlags.FlattenHierarchy); // Remove the ReadOnly property ro.SetValue(headers, false, null); - // Invoke the protected InvalidateCachedArrays method + // Invoke the protected InvalidateCachedArrays method hdr.InvokeMember("InvalidateCachedArrays", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance, null, headers, null); @@ -442,13 +443,19 @@ private bool IsFilteredRequest(HttpContext context) return true; } - // whitelist routes prefix var url = context.Request.Url.AbsolutePath; + + // custom block url check + if (customBlockUrl != null && url == customBlockUrl) { + return true; + } + + // whitelist routes prefix if (routesWhitelist != null) { foreach (var prefix in routesWhitelist) { - if (url.StartsWith(prefix) || url == pxContext.CustomBlockUrl) + if (url.StartsWith(prefix)) { return true; } @@ -539,7 +546,7 @@ private void HandleVerification(HttpApplication application) PxLoggingUtils.LogDebug(string.Format("Invalid request to {0}", application.Context.Request.RawUrl)); PostBlockActivity(pxContext); } - + SetPxhdAndVid(pxContext); // If implemented, run the customVerificationHandler. if (customVerificationHandlerInstance != null) @@ -565,7 +572,7 @@ private static void SetPxhdAndVid(PxContext pxContext) } /// - /// Uses reflection to check whether an IVerificationHandler was implemented by the customer. + /// Uses reflection to check whether an IVerificationHandler was implemented by the customer. /// /// If found, returns the IVerificationHandler class instance. Otherwise, returns null. private static IVerificationHandler GetCustomVerificationHandler(string customHandlerName)