From: Rafael Kitover Date: Wed, 6 May 2009 20:17:12 +0000 (+0000) Subject: C::C::WrapCGI - pass captures in SCRIPT_NAME, new release X-Git-Tag: 0.030~28 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Controller-WrapCGI.git;a=commitdiff_plain;h=17a050f8c51354fe1780496a70ca58dce8de9cb0 C::C::WrapCGI - pass captures in SCRIPT_NAME, new release --- diff --git a/Changes b/Changes index cef07ce..4e7db3c 100644 --- 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) diff --git a/lib/Catalyst/Controller/CGIBin.pm b/lib/Catalyst/Controller/CGIBin.pm index 91982e3..ef1ed86 100644 --- a/lib/Catalyst/Controller/CGIBin.pm +++ b/lib/Catalyst/Controller/CGIBin.pm @@ -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 diff --git a/lib/Catalyst/Controller/WrapCGI.pm b/lib/Catalyst/Controller/WrapCGI.pm index 5991518..0a2d748 100644 --- a/lib/Catalyst/Controller/WrapCGI.pm +++ b/lib/Catalyst/Controller/WrapCGI.pm @@ -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 ); { diff --git a/t/lib/TestApp/Controller/Root.pm b/t/lib/TestApp/Controller/Root.pm index 318c890..d691011 100644 --- a/t/lib/TestApp/Controller/Root.pm +++ b/t/lib/TestApp/Controller/Root.pm @@ -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 { diff --git a/t/wrap-cgi.t b/t/wrap-cgi.t index 200b106..2c98bda 100644 --- a/t/wrap-cgi.t +++ b/t/wrap-cgi.t @@ -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');