[Catalyst] Engine::CGI PROXY_CHECK doesn't account for "double" proxy?

Matt Pitts mpitts at a3its.com
Thu Oct 23 21:28:58 BST 2008

This probably belongs on the DEV list, but I might be missing something
that someone here can help with...

I'm experimenting with E::HTTP::Prefork to hopefully switch over to it
and I've run into a problem that I can't find any historical reference

E::CGI->prepare_path doesn't seem to properly account for multiple
frontend proxies that add their frontend hostnames to
HTTP_X_FORWARDED_HOST in a comma-delimited fashion.
It just takes HTTP_X_FORWARDED_HOST as-is when setting the host portion
of $c->req->base, causing $c-uri_for to return URIs like:

http://frontendproxy.com, backendproxy.local/path/to/desired/action

This is happening with Apache 2.2 mod_proxy (2 instances) and Catalyst

So, is comma separation the right behavior to have in
E::CGI->prepare_path... ?

@hosts = split(/,/, $ENV{HTTP_X_FORWARDED_HOST});
$host = shift @hosts;


More information about the Catalyst mailing list