diff --git a/Modules/UrlTrackerModule.cs b/Modules/UrlTrackerModule.cs index fcce99e..85bc64d 100644 --- a/Modules/UrlTrackerModule.cs +++ b/Modules/UrlTrackerModule.cs @@ -36,14 +36,30 @@ public void Dispose() { } public void Init(HttpApplication context) { - context.AcquireRequestState += context_AcquireRequestState; + context.PostResolveRequestCache += Context_PostResolveRequestCache; context.EndRequest += context_EndRequest; LoggingHelper.LogInformation("UrlTracker HttpModule | Subscribed to AcquireRequestState and EndRequest events"); } + + void Context_PostResolveRequestCache(object sender, EventArgs e) + { + CheckUrlTrackerInstalled(); + + if (_execute) + UrlTrackerDo("AcquireRequestState", ignoreHttpStatusCode: true); + } #endregion - void context_AcquireRequestState(object sender, EventArgs e) + void context_EndRequest(object sender, EventArgs e) + { + CheckUrlTrackerInstalled(); + + if (_execute) + UrlTrackerDo("EndRequest"); + } + + static void CheckUrlTrackerInstalled() { try { @@ -70,15 +86,6 @@ void context_AcquireRequestState(object sender, EventArgs e) { _execute = false; } - - if (_execute) - UrlTrackerDo("AcquireRequestState", ignoreHttpStatusCode: true); - } - - void context_EndRequest(object sender, EventArgs e) - { - if (_execute) - UrlTrackerDo("EndRequest"); } static void UrlTrackerDo(string callingEventName, bool ignoreHttpStatusCode = false) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 7c684a2..c5bb326 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -30,7 +30,7 @@ // Build Number // Revision // -[assembly: AssemblyVersion("3.10.*")] +[assembly: AssemblyVersion("3.11.*")] // SQL [assembly: WebResource("InfoCaster.Umbraco.UrlTracker.SQL.MicrosoftSqlServer.create-table-1.sql", "text/plain")] diff --git a/README.md b/README.md index b17032a..d02e6a3 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ Set to true to disable tracking not found (404) requests. Set to false to disable appending a port number to redirect URLs ## Changelog ## +* 3.11 [2016/02/26] + * [BugFix] Changed the force redirect event handler to PostResolveRequestCache instead of AcquireRequestState (Simple Redirect doesn't work ([#117](https://github.com/kipusoep/UrlTracker/issues/117)) * 3.10 [2016/01/04] * Happy new year! \o/ * [Improvement] Added support for the excellent ([SEO Metadata for Umbraco plug-in by Epiphany](https://our.umbraco.org/projects/backoffice-extensions/seo-metadata-for-umbraco/)) (altering a URL gets tracked) diff --git a/UI/UrlTrackerInfo.aspx b/UI/UrlTrackerInfo.aspx index 6ed2e4f..ce8c4cd 100644 --- a/UI/UrlTrackerInfo.aspx +++ b/UI/UrlTrackerInfo.aspx @@ -86,6 +86,12 @@