Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET Routing contain case sensitive?

I was working with routes in .NET Core and I noticed that when I use the same route but passing it with a lowercase letter, I got access to the same page.

Example: mydomain.com/Account/Login mydomain.com/account/login

Why was there no distinction between uppercase and lowercase in this case? And I am not using services.AddRouting (options => options.LowercaseUrls = true); to allow this.

I just want to know how that letter distinction works and why it continues to work.

like image 207
Yasmin Kruger Avatar asked Sep 06 '25 03:09

Yasmin Kruger


1 Answers

Quote from the Doc :

Text matching is case-insensitive and based on the decoded representation of the URL's path.

And services.AddRouting (options => options.LowercaseUrls = true); is just used to convert the route template to lowercase. But you can still access it with uppercase Url.

like image 112
mj1313 Avatar answered Sep 07 '25 19:09

mj1313