mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-18 23:10:25 +08:00
如果管理系统前端有反向代理,则不要自动从HTTP跳转到HTTPS
This commit is contained in:
@@ -50,10 +50,13 @@ func (this *IndexAction) RunGet(params struct {
|
|||||||
newHost += ":" + types.String(httpsPort)
|
newHost += ":" + types.String(httpsPort)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果没有前端反向代理,则跳转
|
||||||
|
if len(this.Request.Header.Get("X-Forwarded-For")) == 0 && len(this.Request.Header.Get("X-Real-Ip")) == 0 {
|
||||||
this.RedirectURL("https://" + newHost + this.Request.RequestURI)
|
this.RedirectURL("https://" + newHost + this.Request.RequestURI)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// DEMO模式
|
// DEMO模式
|
||||||
this.Data["isDemo"] = teaconst.IsDemoMode
|
this.Data["isDemo"] = teaconst.IsDemoMode
|
||||||
|
|||||||
Reference in New Issue
Block a user