2

Related to this: URL-encoded slash in URL

I used Mehrdad Afshari's answer (wildcard route param) which works mostly! However, multiple slashes are converted to a single slash.

My route is resource/{*url}

With GET resource/abc%2fdef my controller method is called with abc/def.

With GET resource/abc%2f%2f%2f%2fdef my controller method is again called with abc/def. The extra slashes are lost.

Community
  • 1
  • 1
mattk
  • 1,335
  • 1
  • 14
  • 19

1 Answers1

1

Did you see this stackoverflow question plus solution:

URL-encoded slash in URL

this directs you to that post http://gathadams.com/2009/01/06/allowing-special-characters-forward-slash-hash-asterisk-etc-in-aspnet-mvc-urls/

Phil haacked responded like this http://haacked.com/archive/2008/04/10/upcoming-changes-in-routing.aspx#68032

Community
  • 1
  • 1
silverfighter
  • 6,762
  • 10
  • 46
  • 73
  • I did. I desperately hoped there might be a workaround! It looks like there isn't so I will mark this as the correct answer as it is a good summary of the issue. – mattk Sep 25 '12 at 17:33
  • Yeah actually me too ... working with a slug that remove or replaces all exceptional stuff... – silverfighter Oct 05 '12 at 16:09