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

url() does not handle multi-valued X-Forwarded-Host [rt.cpan.org #54487] #25

Closed
leejo opened this issue May 22, 2014 · 2 comments
Closed

Comments

@leejo
Copy link
Owner

leejo commented May 22, 2014

https://rt.cpan.org/Ticket/Display.html?id=54487

The url() method in CGI.pm examines the X-Forwarded-Host header to
determine the vhost name, but does not cater for this header containing
a comma-separated list (which can happen if the request has passed
through multiple reverse proxies).

The apache documentation
<http://httpd.apache.org/docs/2.2/mod/mod_proxy.html> says:

"Be careful when using these headers on the origin server, since they
will contain more than one (comma-separated) value if the original
request already contained one of these headers."

The Catalyst code caters for this by taking the last value in the list.
The attached patch makes CGI.pm follow the same behaviour.
@leejo
Copy link
Owner Author

leejo commented May 22, 2014

mark@summersault.com - 2010-02-10 17:08:12

The url() method in CGI.pm examines the X-Forwarded-Host header to
determine the vhost name, but does not cater for this header containing
a comma-separated list (which can happen if the request has passed
through multiple reverse proxies).

The apache documentation
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html says:

"Be careful when using these headers on the origin server, since they
will contain more than one (comma-separated) value if the original
request already contained one of these headers."

The Catalyst code caters for this by taking the last value in the list.
The attached patch makes CGI.pm follow the same behaviour.

Thanks for the report, Ray.

Would you be willing to add an automated test
to go with it?

Mark

@leejo
Copy link
Owner Author

leejo commented May 22, 2014

raym - 2010-06-08 08:50:58

On Wed Feb 10 12:08:12 2010, mark@summersault.com wrote:

Would you be willing to add an automated test
to go with it?

Yes, of course. Please see attached patch which adds a test.

Ray.

@leejo leejo closed this as completed May 22, 2014
@leejo leejo added the Deleted label May 22, 2014
leejo pushed a commit that referenced this issue May 27, 2014
typo fixes, thanks to dsteinbrunner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant