Revert "Limit url to local site (#20013)"

This reverts commit 54819ba8cd.
This commit is contained in:
stonezdj(Daojun Zhang) 2024-02-23 16:18:28 +08:00 committed by GitHub
parent 54819ba8cd
commit 393ac84b51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 7 deletions

View File

@ -63,13 +63,7 @@ func (oc *OIDCController) RedirectLogin() {
oc.SendInternalServerError(err)
return
}
redirectURL := oc.Ctx.Request.URL.Query().Get("redirect_url")
if strings.HasPrefix(redirectURL, "//") {
log.Errorf("invalid redirect url: %v", redirectURL)
oc.SendBadRequestError(fmt.Errorf("cannot redirect to other site"))
return
}
if err := oc.SetSession(redirectURLKey, redirectURL); err != nil {
if err := oc.SetSession(redirectURLKey, oc.Ctx.Request.URL.Query().Get("redirect_url")); err != nil {
log.Errorf("failed to set session for key: %s, error: %v", redirectURLKey, err)
oc.SendInternalServerError(err)
return