Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Sets the redirect URL default to the original request's path instead … #587

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

owayss
Copy link

@owayss owayss commented May 10, 2018

Fixes #586

@@ -427,7 +427,7 @@ func (p *OAuthProxy) GetRedirect(req *http.Request) (redirect string, err error)

redirect = req.Form.Get("rd")
if redirect == "" || !strings.HasPrefix(redirect, "/") || strings.HasPrefix(redirect, "//") {
redirect = "/"
redirect = req.URL.Path
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not work out because if you visited /oauth2/sign_in or /oauth2/start explicitly, then you end up in a loop

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using like this?

if req.Header.Get("X-Auth-Request-Redirect") != "" {
    redirect = req.Header.Get("X-Auth-Request-Redirect")
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants