0

One of my routes in an MVC project serves documents that have been uploaded.

For SEO and user friendliness purposes I want the document title to be included in the URL, the route will take the ID from the incoming URL, match it with the document then redirect to a URL with the filename appended to the ID. As document titles can have a wide variety of characters in the title including ones that are used to break up parameters the filename is a catchall parameter.

This works fine for almost all characters in the title including reserved ones such as "/" but when the title include the combination "/ " routing breaks. Not just in terms of not match this route but apparently bypassing the entirety of the application and returning a 404, I tried to use Phil Haack's RouteDebugger but that was also giving a 404 rather than catching the request.

My web.config has requestvalidation turned off and I can't seem to find anyway to get the application to catch the request.

Chao
  • 3,033
  • 3
  • 30
  • 36

1 Answers1

0

I would recommend you filtering those character or you will have many headaches. Here's a function you might find interesting.

Community
  • 1
  • 1
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • That was my backup plan but I was rather hoping for a way to catch these requests as is. – Chao Jan 13 '11 at 16:57