开发者

Use a different port with RequireHttps filter in MVC2

Is it possible to use [RequireHttps] filter with a different port other than 443? I can't find开发者_开发百科 much documentation about it.


Steve Sanderson's approach finally worked fine for me. No need to use the MVC2 filters.


Subclass it and override HandleNonHttpsRequest(). From within that method, you can manipulate the URL as necessary. (For example, you can call base.HandleNonHttpsRequest(), then modify the filterContext.Result property to include a port number.) Then use [MyCustomRequireHttps] instead of [RequireHttps] on your actions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜