Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Please add support for X-Forward headers #334

Open
anindyameister opened this issue Sep 18, 2021 · 0 comments
Open

Feature request: Please add support for X-Forward headers #334

anindyameister opened this issue Sep 18, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@anindyameister
Copy link

anindyameister commented Sep 18, 2021

I tried running policy-bot behind a reverse-proxy, working with github enterprise, and it appears that there's no support for X-Forwarded-* Headers. The app appears to only respect Host header.

$ curl -s -H "Forwarded: host=policybot.example.com" http://10.175.174.133:8080/api/github/auth 
<a href="https://github.example.com/login/oauth/authorize?access_type=online&amp;client_id=XXXX&amp;redirect_uri=http%3A%2F%2F10.175.174.133%3A8080%2Fapi%2Fgithub%2Fauth&amp;response_type=code&amp;state=423c1f4ef94adcbdb9013edfdc988b14662d9b5a">Found</a>.

$ curl -s -H "X-Forwarded-Host: policybot.example.com" http://10.175.174.133:8080/api/github/auth 
<a href="https://github.example.com/login/oauth/authorize?access_type=online&amp;client_id=XXXX&amp;redirect_uri=http%3A%2F%2F10.175.174.133%3A8080%2Fapi%2Fgithub%2Fauth&amp;response_type=code&amp;state=7a222f5786384f4ddc0699319018bb1b85de1af8">Found</a>.

$ curl -s -H "Host: policybot.example.com" http://10.175.174.133:8080/api/github/auth 
<a href="https://github.example.com/login/oauth/authorize?access_type=online&amp;client_id=XXXX&amp;redirect_uri=http%3A%2F%2Fpolicybot.example.com%2Fapi%2Fgithub%2Fauth&amp;response_type=code&amp;state=995fd8bfee94f6bb816a12001701a6a0e78da5e9">Found</a>.

Expected result:
The redirect_uri= param should be set with the values sent in forward headers X-Forwarded-Host, and X-Forwarded-Prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants