I want to create a action filter that will check the url, and if its not using Ssl, redirect to the same page but with SSL.
What is the best way of doing this?
Should I just check the RawUrl, and scan the string for https, and if its not there then do:
context.Response.Redirect(context.Request.RawUrl.Replace("http:", "https:"));
There already is one (in MVC 2, at least): RequireSsl
. I think it may be in futures in MVC 1, but I haven't used MVC 1 in a long time.