Armin Obersteiner <[EMAIL PROTECTED]> writes: > From: Armin Obersteiner <[EMAIL PROTECTED]> > Subject: uri rewrite (drop port) > To: [email protected] > Date: Tue, 27 Jun 2006 23:02:21 +0200 > > hi! > > I'd like to drop the port from the base/uri part: > > 'request' => bless( { > 'base' => bless( do{\(my $o = 'http://www:3000/')}, 'URI::http' ), > 'uri' => bless( do{\(my $o = 'http://www:3000/')}, 'URI::http' ), > ... > > Reason: I have an ip range and for each ip port 80 is redirected on my > firewall to some highport of an application server. For the outside user > everything is port 80 and request should go there. > > Somehow Catalyst::Engine::HTTP adds :3000 (or any other port but 80) > to the url. Understandable so far. But not usable in my case. > > I want to drop the port in the most Catalyst compatible way, but I definitely > want/need to do it within Catalyst. (No proxy or rewrite engine beforehand.) > > Can I just overwrite the base/uri objects at an early stage of the > request. When/how? > > I'm a catalyst newbie but read most of the documentation on cpan and > searched the list. No real solution came up, but some $ENV mangling, > this can't be it?
I've had the same problem. You have to overload uri_for method and use it for all links Take look at: <http://kofeina.net/websvn/filedetails.php?repname=SireCSM&path=%2FSireCSM%2Ftrunk%2Flib%2FSireCSM.pm&rev=0&sc=0> sub uri_for { my $c = shift; my $uri = $c->NEXT::uri_for(@_); if ($c->config->{'remove_port'}) { $uri->port( $uri->default_port ); } $uri; } eloy -- [EMAIL PROTECTED] jak to dobrze, że są oceany - bez nich byłoby jeszcze smutniej _______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
