-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Discussed in #53622
Originally posted by gmeister99 January 25, 2024
Hi all, I realise using an encoded forward slash (%2f) in a URL is not advised, however we have a website that uses the 'code' for a record in the URL. A code could be ABC/123. We then use it in the URL to determine what data to display on a generic page, e.g. /somepage/ABC%2f123
This used to work fine, as in the routing would go to the Blazor page with the @page directive "/somepage/{code}. But now, after upgrading the project to .NET 8, this url - /somepage/ABC%2f123 - experiences a page not found error, as it is interpreted by the Blazor routing engine as /somepage/ABC/123, which would be looking for a Blazor page with the @page directive matching "/somepage/{param1}/{param2}", which doesn't exist.
The robust solution would be to change the page to not use the 'code' in the URL, to completely avoid forward slashes. However, this page has worked for a couple of years like this without issue and is now impacting production, so I'm looking for a quick fix. Does anyone know of a setting, or some config that was changed/introduced somwhere in .NET8 that would influence routing?
Thanks