ASP.NET MVC 5 drops trailing period on redirect

Zach

I'm dealing with string IDs in a legacy system. I added relaxedUrlToFileSystemMapping="true" and runAllManagedModulesForAllRequests="true" in the web.config, which fixes 404s when browsing directly to a route ending in a period (i.e. /view/company abc inc.).

RedirectToResult is dropping the trailing period of an entity ID. Why is this? How can I redirect to a route which ends in a period?

Notice the period being lost after redirect

Update: I noticed that the Location header in the redirect is wrong, but the RedirectResult that generates it is correct:

HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=utf-8
Location: http://localhost:3000/view/apple%20inc
Zach

The issue ended up being in the web.config. Changing UseFullyQualifiedRedirectUrl from true to false fixed it.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related