java 重定向 https_使用简单身份验证从HTTP重定向到HTTPS
我希望得到一些关于如何使用带有ember-simple-auth的ember初始化程序将用户从HTTP重定向到HTTPS的建议 .
`import ENV from 'cio/config/environment'`
SSLInitializer =
name: 'ssl'
before: 'simple-auth-cookie-store'
initialize: (container, application) ->
application.deferReadiness()
# Redirect if hitting HTTP and SSL is enabled
if ENV.SSL and window.location.protocol is "http:"
window.location.href = "https:" + window.location.href.substring(window.location.protocol.length)
return false
application.advanceReadiness()
`export default SSLInitializer`
但是,即使if语句的计算结果为true,cookie似乎也会失效 . 我尝试了几件事,包括:
之前:'simple-auth'
之前:'store'
在设置window.location.href之前,if语句中的
application.destroy()
在此方法有效之前,因为我们在index.html中有简单的代码段,但是我们希望将它保存在初始化程序中 . 有什么建议?
谢谢!
总结
以上是生活随笔为你收集整理的java 重定向 https_使用简单身份验证从HTTP重定向到HTTPS的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 【批处理】shift用法举例
- 下一篇: 计算机编辑文档教程,word文档怎么编辑