[Catalyst] Setting $c->req->{base}

Aaron Ross aaron at aaronelliotross.com
Tue Sep 20 09:37:34 CEST 2005


Hi Andy,

Great idea to handle this case transparently.

It's pretty common to run Apache on one set of light webservers and 
mod_perl on another set of beefier machines, so I wouldn't want to make 
this configuration hard to implement.

IMHO, headers are input and code should necessarily be cautious with 
them. Being nice and making them more secure is nice, but shouldn't keep 
you from providing this useful feature.

That said, you could allow a range of addresses rather than just 
127.0.0.1 here:

 > if REMOTE_ADDR is 127.0.0.1:
 >   # get most recent proxied IP from HTTP_X_FORWARDED_FOR
 >   $c->request->address( $ip );

if REMOTE_ADDR is in configured network range
	$c->request->address( $ip );

Aaron



More information about the Catalyst mailing list