[Catalyst] $c->req->base doesn't actually return base

vti mbit at ukr.net
Wed Jan 24 12:38:42 GMT 2007


Matt S Trout(dbix-class at trout.me.uk)@Wed, Jan 24, 2007 at 12:05:11PM +0000:
> 
> On 24 Jan 2007, at 09:04, vti wrote:
> 
> >Hello
> >
> >I wish you could help me.
> >
> >When I switched from mod_perl engine to CGI engine (due to some  
> >circumstanses) $c->req->base stopped returning actually base url.  
> >Instead it is same as $c->req->uri.
> 
> (1) Switch to FastCGI if you possibly can, Catalyst isn't optimised  
> for CGI performance

Well, I understand that :) I have no choice in the current application. 
Others are working under mod_perl and are feeling alright.

> >Have any suggestions about that? Or am I missing something?
> 
> (2) Not without some more information, like the webserver and app  
> config etc. and logs. A full dump of %ENV from within the app would  
> probably help as well.

Webserver is apache2.

Config follows by:
=============================

<VirtualHost pick-up.com.ua:80>
    DocumentRoot /var/www/pickup/htdocs

    <Directory /var/www/pickup/htdocs>
        Options -Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /var/www/pickup/cgi-bin/

    <Directory "/var/www/pickup/cgi-bin/">
        AllowOverride None
        Options ExecCGI
        Order allow,deny
        Allow from all
    </Directory>

</VirtualHost>

=============================

In cgi-bin dir I put pickup.pl:

=============================
#!/usr/bin/perl -w

use strict;
use lib '../lib';
use PickUp;

PickUp->run;
=============================

In htdocs I put .htaccess:

=============================
RewriteEngine On

RewriteRule ^(.*) /cgi-bin/pickup.pl [L]
=============================

Running http://pick-up.com.ua/ru/pages/view/bio?dump_info=1 gives me:
=============================

Request

bless({
  action           => "/view",
  address          => "127.0.0.1",
  arguments        => ["bio"],
  base             => bless(do{\(my $o = "http://pick-up.com.ua/ru/pages/view/bio/")}, "URI::http"),
  body_parameters  => {},
  captures         => ["ru"],
  cookies          => {},
  headers          => bless({
                        "accept" => "text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5",
                        "accept-charset" => "windows-1251,utf-8;q=0.7,*;q=0.7",
                        "accept-encoding" => "gzip,deflate",
                        "accept-language" => "ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3",
                        connection => "keep-alive",
                        host => "pick-up.com.ua",
                        "keep-alive" => 300,
                        "user-agent" => "Mozilla/5.0 (X11; U; Linux i686; ru; rv:1.8.1.1) Gecko/20070102 BonEcho/2.0.0.1",
                      }, "HTTP::Headers"),
  hostname         => undef,
  match            => "/view",
  method           => "GET",
  parameters       => { dump_info => 1 },
  path             => "ru/pages/view/bio",
  protocol         => "HTTP/1.1",
  query_parameters => { dump_info => 1 },
  secure           => 0,
  uploads          => {},
  uri              => bless(do{\(my $o = "http://pick-up.com.ua/ru/pages/view/bio?dump_info=1")}, "URI::http"),
  user             => undef,
}, "Catalyst::Request")

=============================

-- 
vti -- Viacheslav Tikhanovskii




More information about the Catalyst mailing list