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

Use forward headers for location lookup #1571

Closed
kpdecker opened this issue Apr 14, 2014 · 5 comments
Closed

Use forward headers for location lookup #1571

kpdecker opened this issue Apr 14, 2014 · 5 comments
Assignees
Labels
feature New functionality or improvement

Comments

@kpdecker
Copy link
Contributor

Right now only the host header is used for inferencing the location parameter for relative redirects.

Rather than using only the host header, hapi should look at the various forwarded for, etc headers that proxies such as Akamai might set and use these first, failing over to the host header should those not be defined.

@hueniverse
Copy link
Contributor

Where is the current code you are referring to?

@kpdecker
Copy link
Contributor Author

https://github.com/spumko/hapi/blob/master/docs/Reference.md#server.config.location is the doced behavior.

https://github.com/spumko/hapi/blob/master/lib/response/headers.js#L44 is the hapi code

X-Forward-Host seems to be the most common header, but I've seen some others referencing X-Host but less formal documentation on that.
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers

@hueniverse
Copy link
Contributor

What if there are multiple x-forward-host values listed (comma separated)? Use the previous or first?

@hueniverse
Copy link
Contributor

Replaced by #1747

@hueniverse hueniverse self-assigned this Aug 24, 2014
@Marsup Marsup added feature New functionality or improvement and removed request labels Sep 20, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New functionality or improvement
Projects
None yet
Development

No branches or pull requests

3 participants