[Catalyst-commits] r6267 - /
trunk/Catalyst-Runtime/lib/Catalyst/Engine
zarquon at dev.catalyst.perl.org
zarquon at dev.catalyst.perl.org
Wed Apr 4 01:41:40 GMT 2007
Author: zarquon
Date: 2007-04-04 01:41:39 +0100 (Wed, 04 Apr 2007)
New Revision: 6267
Modified:
/
trunk/Catalyst-Runtime/lib/Catalyst/Engine/CGI.pm
Log:
r9741 at zaphod: kd | 2007-03-12 11:53:33 +1100
trailing slash for non-root deployment fix by jayk
Property changes on:
___________________________________________________________________
Name: svk:merge
- 1b129c88-ebf4-0310-add9-f09427935aba:/local/catalyst:4278
1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst:9733
3b9770f9-e80c-0410-a7de-cd203d167417:/local/catalyst:3514
dd8ad9ea-0304-0410-a433-df5f223e7bc0:/local/Catalyst:6909
+ 1b129c88-ebf4-0310-add9-f09427935aba:/local/catalyst:4278
1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst:9741
3b9770f9-e80c-0410-a7de-cd203d167417:/local/catalyst:3514
dd8ad9ea-0304-0410-a433-df5f223e7bc0:/local/Catalyst:6909
Modified: trunk/Catalyst-Runtime/lib/Catalyst/Engine/CGI.pm
===================================================================
--- trunk/Catalyst-Runtime/lib/Catalyst/Engine/CGI.pm 2007-04-04 00:41:12 UTC (rev 6266)
+++ trunk/Catalyst-Runtime/lib/Catalyst/Engine/CGI.pm 2007-04-04 00:41:39 UTC (rev 6267)
@@ -135,7 +135,10 @@
$port = $c->request->secure ? 443 : 80;
}
- # set the request URI
+ # set the base URI
+ # base must end in a slash
+ $base_path .= '/' unless ( $base_path =~ /\/$/ );
+
my $path = $base_path . ( $ENV{PATH_INFO} || '' );
$path =~ s{^/+}{};
@@ -158,13 +161,12 @@
$c->request->uri( bless \$uri, $uri_class );
- # set the base URI
- # base must end in a slash
- $base_path .= '/' unless $base_path =~ m{/$};
-
- my $base_uri = $scheme . '://' . $host . $base_path;
-
- $c->request->base( bless \$base_uri, $uri_class );
+ # sanitize the URI
+ $uri = $uri->canonical;
+ $c->request->uri($uri);
+ my $base = $uri->clone;
+ $base->path_query($base_path);
+ $c->request->base($base);
}
=head2 $self->prepare_query_parameters($c)
More information about the Catalyst-commits
mailing list