Use a different port with RequireHttps filter in MVC2

Can the filter be used [RequireHttps]

with a port other than 443? I can't find much documentation on this.

+2


a source to share


2 answers


Steve Sanderson's approach finally worked great for me. There is no need to use MVC2 filters.



+2


a source


Subclass and override HandleNonHttpsRequest (). From this method, you can manipulate the url as needed. (For example, you can call base.HandleNonHttpsRequest () and then change the filterContext.Result property to include the port number.) Then use [MyCustomRequireHttps] instead of [RequireHttps] for your actions.



+1


a source







All Articles