Convert URLs to fully-qualified for HTTP redirects (#19020)

* Convert URLs to fully-qualified for HTTP redirects

* forgot the tests
Этот коммит содержится в:
Lev
2021-11-23 08:51:25 -08:00
коммит произвёл GitHub
родитель 8440a754b4
Коммит 03f43d7ae5
3 изменённых файлов: 29 добавлений и 6 удалений

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

@@ -110,6 +110,7 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
redirectURL = val
hasRedirectURL = val != ""
}
redirectURL = fullyQualifiedRedirectURL(c.GetSiteURLHeader(), redirectURL)
handleError := func(err *model.AppError) {
if isMobile && hasRedirectURL {
@@ -184,7 +185,6 @@ func completeSaml(c *Context, w http.ResponseWriter, r *http.Request) {
})
utils.RenderMobileAuthComplete(w, redirectURL)
} else {
redirectURL = c.GetSiteURLHeader() + redirectURL
http.Redirect(w, r, redirectURL, http.StatusFound)
}
return