问题
I currently have a .NET angular 2 program, with a route styled as
<ControllerName>/:id
Run on localhost with IIS Express, the id route param automatically converts to lowercase in the URL without me expressly doing any extra formatting. When calling the same controller and using matrix notation to input ID, however, it loses it's ability to automatically become lowercase
<ControllerName>;id=<CAPSGUID>
Curious thing is, when I host this on an IIS server, this functionality is somehow lost and the id route param remains upper case either way. Does anyone have any experience as to why this might happen? I've been having a hard time trying to properly word the question to get any related information.
回答1:
I couldn't find out the reason this was happening, and through the course of my testing the functionality disappeared. I ended up using a custom url serializer implementing DefaultUrlSerializer and adding conditions in which to automatically lowercase my GUID component. Hope this helps somebody.
来源:https://stackoverflow.com/questions/46231591/angular-2-route-param-automatically-converting-to-lowercase-on-localhost-but-rem