C::C::WrapCGI - pass captures in SCRIPT_NAME, new release
Rafael Kitover [Wed, 6 May 2009 20:17:12 +0000 (20:17 +0000)]
Changes
lib/Catalyst/Controller/CGIBin.pm
lib/Catalyst/Controller/WrapCGI.pm
t/lib/TestApp/Controller/Root.pm
t/wrap-cgi.t

diff --git a/Changes b/Changes
index cef07ce..4e7db3c 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Catalyst-Controller-WrapCGI
 
+0.0037  2009-05-06 20:07:00
+    - pass captures in SCRIPT_NAME (caelum)
+
 0.0036  2009-05-05 19:45:20
     - fix deps (caelum)
 
index 91982e3..ef1ed86 100644 (file)
@@ -23,11 +23,11 @@ Catalyst::Controller::CGIBin - Serve CGIs from root/cgi-bin
 
 =head1 VERSION
 
-Version 0.014
+Version 0.015
 
 =cut
 
-our $VERSION = '0.014';
+our $VERSION = '0.015';
 
 =head1 SYNOPSIS
 
index 5991518..0a2d748 100644 (file)
@@ -20,11 +20,11 @@ Catalyst::Controller::WrapCGI - Run CGIs in Catalyst
 
 =head1 VERSION
 
-Version 0.0036
+Version 0.0037
 
 =cut
 
-our $VERSION = '0.0036';
+our $VERSION = '0.0037';
 
 =head1 SYNOPSIS
 
@@ -214,7 +214,7 @@ sub wrap_cgi {
               PATH_INFO => $path_info,
 # eww, this is likely broken:
               FILEPATH_INFO => '/'.$c->action.$path_info,
-              SCRIPT_NAME => $c->uri_for($c->action)->path
+              SCRIPT_NAME => $c->uri_for($c->action, $c->req->captures)->path
             );
 
   {
index 318c890..d691011 100644 (file)
@@ -45,7 +45,9 @@ sub test_filepath_info : Path('/cgi-bin/test_filepathinfo.cgi') {
     });
 }
 
-sub test_script_name : Path('/cgi-bin/test_scriptname.cgi') {
+sub test_script_name_root : Chained('/') PathPart('cgi-bin') CaptureArgs(1) {}
+
+sub test_script_name : Chained('test_script_name_root') PathPart('test_scriptname.cgi') Args {
     my ($self, $c) = @_;
 
     $self->cgi_to_response($c, sub {
index 200b106..2c98bda 100644 (file)
@@ -49,6 +49,6 @@ $response = request '/cgi-bin/test_filepathinfo.cgi/path/%2Finfo';
 is($response->content, '/test_filepath_info/path/%2Finfo',
     'FILEPATH_INFO is correct (maybe)');
 
-$response = request '/cgi-bin/test_scriptname.cgi/foo/bar';
-is($response->content, '/cgi-bin/test_scriptname.cgi',
+$response = request '/cgi-bin/mtfnpy/test_scriptname.cgi/foo/bar';
+is($response->content, '/cgi-bin/mtfnpy/test_scriptname.cgi',
     'SCRIPT_NAME is correct');