Preserve query when building redirect (fix for #695) (#696)

* Add test for GetRedirect to check query and fragments.

* Preserve query and fragment when building redirect.

* Add changelog entry for redirect fix
This commit is contained in:
Andy Voltz
2020-07-21 16:38:13 +01:00
committed by GitHub
parent c5da3dff9c
commit 88ef888752
3 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -454,7 +454,8 @@ func (p *OAuthProxy) GetRedirect(req *http.Request) (redirect string, err error)
redirect = req.Form.Get("rd")
}
if !p.IsValidRedirect(redirect) {
redirect = req.URL.Path
// Use RequestURI to preserve ?query
redirect = req.URL.RequestURI()
if strings.HasPrefix(redirect, p.ProxyPrefix) {
redirect = "/"
}