RickStrahl / Westwind.AspNetCore

ASP.NET Core Helpers and Utilities
MIT License
129 stars 24 forks source link

Missing trailing slash causes out of index exception #7

Closed jjestrellaa closed 5 years ago

jjestrellaa commented 5 years ago

I have a subsite under my domain and now when I try to navigate to its landing page I get this error:

An unhandled exception has occurred while executing the request. System.ArgumentOutOfRangeException: startIndex cannot be larger than length of string. Parameter name: startIndex at System.String.Substring(Int32 startIndex, Int32 length) at Westwind.AspNetCore.Markdown.MarkdownPageProcessorMiddleware.InvokeAsync(HttpContext context) at Microsoft.AspNetCore.HttpsPolicy.HstsMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.Invoke(HttpContext context)

If I add a trailing slash then the page works correctly.

https://myweb.com/subsite - doesn't work https://myweb.com/subsite/ - this works (hits the home controller and displays the index page)

Any clues?

Thanks.

RickStrahl commented 5 years ago

Can you please repost this in the Westwind.AspNetCore.Markdown repository? The Markdown features have been moved over there.