[Catalyst-commits] r13166 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst/Engine t/aggregate
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Sun Apr 18 23:03:56 GMT 2010
Author: t0m
Date: 2010-04-19 00:03:56 +0100 (Mon, 19 Apr 2010)
New Revision: 13166
Modified:
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm
Catalyst-Runtime/5.80/trunk/t/aggregate/unit_core_engine_cgi-prepare_path.t
Log:
Fix unquoted regex as per RT#24951
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2010-04-17 16:31:39 UTC (rev 13165)
+++ Catalyst-Runtime/5.80/trunk/Changes 2010-04-18 23:03:56 UTC (rev 13166)
@@ -9,6 +9,8 @@
->cleanup feature. (RT#41442)
- Ensure that Catalyst::Engine::HTTP's options hash is defined before
dereferencing it. (RT#49267)
+ - Fix regex special characters in REDIRECT_URL variable breaking
+ the request base. (2nd part of RT#24951)
New features:
- Setting __PACKAGE__->config(enable_catalyst_header => 1); in your MyApp.pm
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm 2010-04-17 16:31:39 UTC (rev 13165)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/CGI.pm 2010-04-18 23:03:56 UTC (rev 13166)
@@ -123,7 +123,7 @@
my $base_path;
if ( exists $ENV{REDIRECT_URL} ) {
$base_path = $ENV{REDIRECT_URL};
- $base_path =~ s/$ENV{PATH_INFO}$//;
+ $base_path =~ s/\Q$ENV{PATH_INFO}\E$//;
}
else {
$base_path = $script_name || '/';
Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/unit_core_engine_cgi-prepare_path.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/unit_core_engine_cgi-prepare_path.t 2010-04-17 16:31:39 UTC (rev 13165)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/unit_core_engine_cgi-prepare_path.t 2010-04-18 23:03:56 UTC (rev 13166)
@@ -97,7 +97,22 @@
is ''.$r->base, 'http://www.foo.com/tx/';
}
+# test req->base and c->uri_for work correctly after an internally redirected request
+# (i.e. REDIRECT_URL set) when the PATH_INFO contains a regex
+{
+ my $path = '/engine/request/uri/Rx(here)';
+ my $r = get_req (
+ SCRIPT_NAME => '/',
+ PATH_INFO => $path,
+ REQUEST_URI => $path,
+ REDIRECT_URL => $path,
+ );
+ is $r->path, 'engine/request/uri/Rx(here)', 'URI contains correct path';
+ is $r->base, 'http://www.foo.com/', 'Base is correct';
+}
+
+
# FIXME - Test proxy logic
# - Test query string
# - Test non standard port numbers
More information about the Catalyst-commits
mailing list