Skip to content

Commit

Permalink
Allow redirect URL to be provided as ?rd=XXX
Browse files Browse the repository at this point in the history
In addition to the X-Auth-Request-Redirect header, which
still has precedence.

Fixes bitly#427
  • Loading branch information
boivie committed Sep 30, 2017
1 parent 7b26256 commit 0434260
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ func (p *OAuthProxy) SignInPage(rw http.ResponseWriter, req *http.Request, code
redirect_url := req.URL.RequestURI()
if req.Header.Get("X-Auth-Request-Redirect") != "" {
redirect_url = req.Header.Get("X-Auth-Request-Redirect")
} else if req.URL.Query().Get("rd") != "" {
redirect_url = req.URL.Query().Get("rd")
}
if redirect_url == p.SignInPath {
redirect_url = "/"
Expand Down

0 comments on commit 0434260

Please sign in to comment.