MVC Url with query string fails if the query string ends in a period
I am running Sitefinity using Hybrid MVC mode. Within my view, I redirect the page to the following URL that has a query string parameter with a trailing period
which fails with the following error:
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /programactivities/registration/Error/An unknown error occurred while trying to accept the conditions./
However, if I remove the trailing period in the URL or move the period to anywhere else in the query string, the redirect is successful. For example, the following URLs work:
period at beginning of query string
period in middle of query string
periods all over the place except at the end
Even worse, I am getting the following error when there is an encoded colon in the query string.
A potentially dangerous Request.Path value was detected from the client (:).
Here's the URL:
Both of the problems (trailing period and escaped colon) seem like inherent problems with the way Sitefinity passes the query string parameters. Is there some way I can pass arbitrary encoded query string parameters to my controller action without worrying about the URL being considered malformed or dangerous?
In the meantime, I'm going to look into using HttpPost as a workaround.
Hello Bo,
The first problem you have reported is standard behavior. The MVC framework tends to treat periods as delimiters. Please try adding the following to your web.config's HTTPRuntime tag:
<
httpRuntime
relaxedUrlToFileSystemMapping
=
"true"
/>
Wondering if you remember how you resolved this error:
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."