Thursday, 15 September 2011

asp.net mvc - requireSsl mvc attribute : working with returlUrl -


There is [needSsl] on my account administrator.

This only works for all tasks Login action I believe the login process is called follws:

  new {controller = "account",  Return Url = HttpContext.Current.Request.RawUrl} Account / Login? Return URL ... Account / Login% 3freturnUrl ...  

When changing https as a result of second line in bad request

Edit: The problem is that "?" The character is changed with "% 3F" I tried to do it with the URL rewire in iis7 and the same thing is the reason why and how to fix it?

UPDATE: I have got HTTPS to work using IIS rewrite, but not according to MVC as described above. I removed the SSL and did it completely in the IIS. I still want to know why it does not work in MVC

This is due to the tasks you have described Does not work: The? It is a bug when the character is encoding it should not be done.

Original EssentialLL Code:

  UriBuilder Builder = New UriBuilder {scheme = "https", host = filterContext.HttpContext.Request.Url.Host, // encoded Goes and should not be included in it? Path = filterContext.HttpContext.Request.RawUrl}; FilterContext.Result = New Redirect Result (Builder.ToString ());  

Maybe change to something like

  UriBuilder Builder = new UriBuilder {plan = "https", host = filterContext.HttpContext.Request.Url should be done. Host, path = filterContext.HttpContext.Request.Path, query = filterContext.HttpContext.Request.QueryString.ToString ()}; FilterContext.Result = New Redirect Result (Builder.ToString ());  

No comments:

Post a Comment