Infocaster / UrlTracker

An Umbraco package that tracks 404 not found results and helps you redirect visitors to the right page
https://infocaster.net/wat-we-doen/umbraco-plugins/301-url-tracker
MIT License
17 stars 12 forks source link

ArgumentOutOfRangeException when creating redirect to node in 13.2.0 #193

Open BrinkTP opened 2 hours ago

BrinkTP commented 2 hours ago

ArgumentOutOfRangeException when creating redirect to node _Using version: 13.2.0 After upgrading to 13.2.0, when creating a redirect from an url to a content node, an ArgumentOutOfRangeException occurs

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Redirects`
  2. Click on '+ new redirect'
  3. Set Permanent (301)
  4. Add Incoming Url (e.g. http://localhost:8031/test or /test)
  5. By content, pick a node ( e.g. home)
  6. Click save
  7. Go to http://localhost:8031/test -> ArgumentOutOfRangeException

Expected behavior Expected to be redirected to http://localhost:8031/ when navigating to http://localhost:8031/test

Screenshots image

Desktop (please complete the following information):

Stacktrace ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'This url cannot be converted to a string with url type 'Absolute'')

UrlTracker.Core.Models.Url.ToString(UrlType urlType, bool ensureTrailingSlash, bool excludeQuery) System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. (Parameter 'This url cannot be converted to a string with url type 'Absolute'') at UrlTracker.Core.Models.Url.ToString(UrlType urlType, Boolean ensureTrailingSlash, Boolean excludeQuery) at UrlTracker.Web.Processing.Handling.ContentRedirectResponseInterceptHandler.GetUrl(HttpContext context, Redirect intercept, ContentPageTargetStrategy target) at UrlTracker.Web.Processing.Handling.RedirectResponseInterceptHandler`1.HandleAsync(RequestDelegate next, HttpContext context, Redirect intercept) at UrlTracker.Middleware.UrlTrackerRedirectMiddleware.InvokeAsync(HttpContext context) at UrlTracker.Middleware.UrlTrackerClientErrorTrackingMiddleware.InvokeAsync(HttpContext context) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Session.SessionMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at StackExchange.Profiling.MiniProfilerMiddleware.Invoke(HttpContext context) in C:\projects\dotnet\src\MiniProfiler.AspNetCore\MiniProfilerMiddleware.cs:line 112 at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>cDisplayClass2_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at Umbraco.Cms.Web.Common.Middleware.PreviewAuthenticationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>cDisplayClass2_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at Umbraco.Cms.Web.Common.Middleware.UmbracoRequestLoggingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>cDisplayClass2_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at SixLabors.ImageSharp.Web.Middleware.ImageSharpMiddleware.Invoke(HttpContext httpContext, Boolean retry) at Umbraco.Forms.Web.HttpModules.ProtectFormUploadRequestsMiddleware.InvokeAsync(HttpContext context, RequestDelegate next) at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.InterfaceMiddlewareBinder.<>cDisplayClass2_0.<b0>d.MoveNext() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

D-Inventor commented 2 hours ago

Hi @BrinkTP , thank you for reaching out and reporting this bug! We're going to have a closer look to see what's going on and we'll let you know about our findings!