+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / MVC Url with query string fails if the query string ends in a period

MVC Url with query string fails if the query string ends in a period

4 posts, 1 answered
  1. Bo Chulindra
    Bo Chulindra avatar
    35 posts
    Registered:
    17 Dec 2013
    16 Oct 2014
    Link to this post

    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

     http://localhost:18806/programactivities/registration/Error/An%20unknown%20error%20occurred%20while%20trying%20to%20accept%20the%20conditions./

     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

     http://localhost:18806/programactivities/registration/Error/.An%20unknown%20error%20occurred%20while%20trying%20to%20accept%20the%20conditions/

    period in middle of query string

    http://localhost:18806/programactivities/registration/Error/An%20unknown%20error%20occ.urred%20while%20trying%20to%20accept%20the%20conditions/

     periods all over the place except at the end

    http://localhost:18806/programactivities/registration/Error/.An%20unkno.wn%20e.rror%20occur.red%20whil.e%20try.ing%20to%20ac.cept%20t.he%20c.onditions/


  2. Bo Chulindra
    Bo Chulindra avatar
    35 posts
    Registered:
    17 Dec 2013
    17 Oct 2014
    Link to this post

    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:

    http://localhost:18806/programactivities/registration/Error/The%20event%20%3AFoo%20is%20not%20open/

     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.

  3. Ivan D. Dimitrov
    Ivan D. Dimitrov avatar
    310 posts
    Registered:
    26 Mar 2015
    21 Oct 2014
    Link to this post
    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" />

    Regarding the second problem - you should not experience the error seeing that you have encoded your URL request. Your workaround is plausible but in general I would advise you refrain from including special characters in your URL. 

    Regards,
    Ivan D. Dimitrov
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
    Answered
  4. Ahsan
    Ahsan avatar
    9 posts
    Registered:
    23 Dec 2014
    17 Mar 2015
    Link to this post

    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."

4 posts, 1 answered