java 重定向 https_使用简单身份验证从HTTP重定向到HTTPS
我希望得到一些關(guān)于如何使用帶有ember-simple-auth的ember初始化程序?qū)⒂脩魪腍TTP重定向到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語句的計算結(jié)果為true,cookie似乎也會失效 . 我嘗試了幾件事,包括:
之前:'simple-auth'
之前:'store'
在設(shè)置window.location.href之前,if語句中的
application.destroy()
在此方法有效之前,因為我們在index.html中有簡單的代碼段,但是我們希望將它保存在初始化程序中 . 有什么建議?
謝謝!
總結(jié)
以上是生活随笔為你收集整理的java 重定向 https_使用简单身份验证从HTTP重定向到HTTPS的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【批处理】shift用法举例
- 下一篇: 计算机编辑文档教程,word文档怎么编辑