MVC3 [RequireHttps]之后如何确保使用非https
我找到了这篇文章,它看起来像我需要的应用程序,我的问题是你怎么做当不再需要 https 时恢复为纯 http?它本质上会基于没有 [RequireHttps]
注释的操作来执行此操作吗?
编辑:我发现有几篇文章讨论从 https 迁移到 http (此处 & 此处) 。但是,我仍然希望回答下面的问题。
或者,我曾讨论过是否要在新窗口中打开应用程序。 https 仅适用于新窗口是一个合理的假设吗?
I found This Post and it looks like what I was needing for an application, my question is how do you revert back to plain http when https is no longer needed? Will it inherently do this based on an action not having the [RequireHttps]
annotation?
EDIT: I found a couple posts talking about moving from https to http (here & here). However, I'd still appreciate an answer to the question below.
Alternately, I had debated on having the application open in a new window. Is it a fair assumption that the https will only apply to the new window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ASP.NET MVC 的 RequireHttps 仅采用一种方式。过去,我刚刚创建了自己的 FilterAttribute 实现,以允许双向传输:
EnsureHttpsAttribute
EnsureHttpAttribute
如果没记错的话,与 RequireHttpsAttribute 的实现几乎相同;尽管上面的实现检查它是否是本地请求并忽略切换到 HTTPS。
ASP.NET MVC's RequireHttps only goes one way. In the past I have just created my own FilterAttribute implementation to allow travel both ways:
EnsureHttpsAttribute
EnsureHttpAttribute
Almost the same implementation as RequireHttpsAttribute if memory serves; although the above implementation checks if it is a
Local
request and ignores the switch to HTTPS.我建议您阅读这篇文章:
http: //www.codehosting.net/blog/BlogEngine/post/More-fiddle-with-MVC3-and-https.aspx
I suggest you read this post:
http://www.codehosting.net/blog/BlogEngine/post/More-fiddling-with-MVC3-and-https.aspx