mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-05-23 22:40:31 +02:00
Merge pull request #248 from VidAngel/support-x-auth-request-redirect
More fully support X-Auth-Request-Redirect header
This commit is contained in:
commit
721d28bd4f
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
# v4.0.0
|
# v4.0.0
|
||||||
|
|
||||||
|
- [#248](https://github.com/pusher/oauth2_proxy/pull/248) Fix issue with X-Auth-Request-Redirect header being ignored
|
||||||
|
|
||||||
## Release Highlights
|
## Release Highlights
|
||||||
- Documentation is now on a [microsite](https://pusher.github.io/oauth2_proxy/)
|
- Documentation is now on a [microsite](https://pusher.github.io/oauth2_proxy/)
|
||||||
- Health check logging can now be disabled for quieter logs
|
- Health check logging can now be disabled for quieter logs
|
||||||
|
@ -249,6 +249,8 @@ server {
|
|||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Scheme $scheme;
|
proxy_set_header X-Scheme $scheme;
|
||||||
proxy_set_header X-Auth-Request-Redirect $request_uri;
|
proxy_set_header X-Auth-Request-Redirect $request_uri;
|
||||||
|
# or, if you are handling multiple domains:
|
||||||
|
# proxy_set_header X-Auth-Request-Redirect $scheme://$host$request_uri;
|
||||||
}
|
}
|
||||||
location = /oauth2/auth {
|
location = /oauth2/auth {
|
||||||
proxy_pass http://127.0.0.1:4180;
|
proxy_pass http://127.0.0.1:4180;
|
||||||
|
@ -480,7 +480,10 @@ func (p *OAuthProxy) GetRedirect(req *http.Request) (redirect string, err error)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
redirect = req.Form.Get("rd")
|
redirect = req.Header.Get("X-Auth-Request-Redirect")
|
||||||
|
if req.Form.Get("rd") != "" {
|
||||||
|
redirect = req.Form.Get("rd")
|
||||||
|
}
|
||||||
if !p.IsValidRedirect(redirect) {
|
if !p.IsValidRedirect(redirect) {
|
||||||
redirect = req.URL.Path
|
redirect = req.URL.Path
|
||||||
if strings.HasPrefix(redirect, p.ProxyPrefix) {
|
if strings.HasPrefix(redirect, p.ProxyPrefix) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user