Get protocol correctly if using SSL direct to Mattermost (#6361)

Этот коммит содержится в:
Joram Wilander
2017-05-09 16:01:16 -04:00
коммит произвёл GitHub
родитель 8c8d9dbf8f
Коммит 535eb14eeb

Просмотреть файл

@@ -138,7 +138,7 @@ func DoLogin(w http.ResponseWriter, r *http.Request, user *model.User, deviceId
}
func GetProtocol(r *http.Request) string {
if r.Header.Get(model.HEADER_FORWARDED_PROTO) == "https" {
if r.Header.Get(model.HEADER_FORWARDED_PROTO) == "https" || r.TLS != nil {
return "https"
} else {
return "http"