mirror of
https://github.com/goharbor/harbor
synced 2024-09-20 10:45:37 +00:00
Revert "Limit url to local site (#20013)"
This reverts commit 54819ba8cd
.
This commit is contained in:
parent
54819ba8cd
commit
393ac84b51
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user