r66502 - in /branches/upstream/libplack-perl/current: ./ lib/ lib/Plack/ lib/Plack/Handler/ lib/Plack/Server/ lib/Plack/Test/ t/ t/Plack-Handler/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Mon Dec 27 16:21:46 UTC 2010
Author: jawnsy-guest
Date: Mon Dec 27 16:21:35 2010
New Revision: 66502
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=66502
Log:
[svn-upgrade] new version libplack-perl (0.9960)
Modified:
branches/upstream/libplack-perl/current/Changes
branches/upstream/libplack-perl/current/META.yml
branches/upstream/libplack-perl/current/lib/Plack.pm
branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm
branches/upstream/libplack-perl/current/lib/Plack/Handler/FCGI.pm
branches/upstream/libplack-perl/current/lib/Plack/Request.pm
branches/upstream/libplack-perl/current/lib/Plack/Response.pm
branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm
branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm
branches/upstream/libplack-perl/current/t/FCGIUtils.pm
branches/upstream/libplack-perl/current/t/Plack-Handler/apache2.t
branches/upstream/libplack-perl/current/t/Plack-Handler/cgi.t
branches/upstream/libplack-perl/current/t/Plack-Handler/fcgi.t
Modified: branches/upstream/libplack-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/Changes?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/Changes (original)
+++ branches/upstream/libplack-perl/current/Changes Mon Dec 27 16:21:35 2010
@@ -1,6 +1,10 @@
Revision history for Perl extension Plack
Take a look at http://github.com/miyagawa/Plack/issues for the planned changes before 1.0 release.
+
+0.9960 Sat Dec 25 11:16:08 PST 2010
+ - FCGI: Fixed the bug introduced in 0.9958 where PATH_INFO contains the SCRIPT_NAME value (ambs)
+ - Improved the FastCGI and Apache2 test infrastructure to test SCRIPT_NAME values
0.9959 Tue Dec 21 11:38:08 PST 2010
- Apache2: Fixed the regression bug around LocationMatch caused by fixes in 0.9958 (cho45)
Modified: branches/upstream/libplack-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/META.yml?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/META.yml (original)
+++ branches/upstream/libplack-perl/current/META.yml Mon Dec 27 16:21:35 2010
@@ -38,4 +38,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: git://github.com/miyagawa/Plack.git
-version: 0.9959
+version: 0.9960
Modified: branches/upstream/libplack-perl/current/lib/Plack.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack.pm?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack.pm Mon Dec 27 16:21:35 2010
@@ -3,7 +3,7 @@
use strict;
use warnings;
use 5.008_001;
-our $VERSION = '0.9959';
+our $VERSION = '0.9960';
$VERSION = eval $VERSION;
1;
Modified: branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm Mon Dec 27 16:21:35 2010
@@ -97,7 +97,11 @@
my $location = $r->location;
# Let's *guess* if we're in a LocationMatch directive
- if ($path_info =~ s{^($location)/?}{/}) {
+ if ($location eq '/') {
+ # <Location /> could be handled as a 'root' case where we make
+ # everything PATH_INFO and empty SCRIPT_NAME as in the PSGI spec
+ $env->{SCRIPT_NAME} = '';
+ } elsif ($path_info =~ s{^($location)/?}{/}) {
$env->{SCRIPT_NAME} = $1 || '';
} else {
# Apache's <Location> is matched but here is not.
Modified: branches/upstream/libplack-perl/current/lib/Plack/Handler/FCGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Handler/FCGI.pm?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Handler/FCGI.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Handler/FCGI.pm Mon Dec 27 16:21:35 2010
@@ -104,9 +104,10 @@
delete $env->{HTTP_CONTENT_TYPE};
delete $env->{HTTP_CONTENT_LENGTH};
- # recover multiple slashes
+ # lighttpd munges multiple slashes in PATH_INFO into one. Try recovering it
my $uri = URI->new($env->{REQUEST_URI});
$env->{PATH_INFO} = uri_unescape($uri->path);
+ $env->{PATH_INFO} =~ s/^\Q$env->{SCRIPT_NAME}\E//;
if ($env->{SERVER_SOFTWARE} && $env->{SERVER_SOFTWARE} =~ m!lighttpd[-/]1\.(\d+\.\d+)!) {
no warnings;
Modified: branches/upstream/libplack-perl/current/lib/Plack/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Request.pm?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Request.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Request.pm Mon Dec 27 16:21:35 2010
@@ -2,7 +2,7 @@
use strict;
use warnings;
use 5.008_001;
-our $VERSION = '0.9959';
+our $VERSION = '0.9960';
$VERSION = eval $VERSION;
use HTTP::Headers;
@@ -542,7 +542,8 @@
Returns GET and POST parameters with a CGI.pm-compatible param
method. This is an alternative method for accessing parameters in
-$req->parameters.
+$req->parameters. Unlike CGI.pm, it does I<not> allow
+setting or modifying query parameters.
$value = $req->param( 'foo' );
@values = $req->param( 'foo' );
Modified: branches/upstream/libplack-perl/current/lib/Plack/Response.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Response.pm?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Response.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Response.pm Mon Dec 27 16:21:35 2010
@@ -1,7 +1,7 @@
package Plack::Response;
use strict;
use warnings;
-our $VERSION = '0.9959';
+our $VERSION = '0.9960';
$VERSION = eval $VERSION;
use Plack::Util::Accessor qw(body status);
Modified: branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm Mon Dec 27 16:21:35 2010
@@ -1,6 +1,6 @@
package Plack::Server::ServerSimple;
use strict;
-our $VERSION = '0.9959';
+our $VERSION = '0.9960';
$VERSION = eval $VERSION;
use parent qw(Plack::Handler::HTTP::Server::Simple);
Modified: branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm Mon Dec 27 16:21:35 2010
@@ -16,13 +16,25 @@
my $share_dir = try { File::ShareDir::dist_dir('Plack') } || 'share';
-$ENV{PLACK_TEST_PATH_PREFIX} = '';
+$ENV{PLACK_TEST_SCRIPT_NAME} = '';
# 0: test name
# 1: request generator coderef.
# 2: request handler
# 3: test case for response
our @TEST = (
+ [
+ 'SCRIPT_NAME',
+ sub {
+ my $cb = shift;
+ my $res = $cb->(GET "http://127.0.0.1/");
+ is $res->content, $ENV{PLACK_TEST_SCRIPT_NAME};
+ },
+ sub {
+ my $env = shift;
+ return [ 200, ["Content-Type", "text/plain"], [ $env->{SCRIPT_NAME} ] ];
+ },
+ ],
[
'GET',
sub {
@@ -478,7 +490,7 @@
sub {
my $cb = shift;
my $res = $cb->(GET "http://127.0.0.1/foo/bar%20baz%73?x=a");
- is $res->content, ($ENV{PLACK_TEST_PATH_PREFIX} || '') . "/foo/bar%20baz%73?x=a";
+ is $res->content, $ENV{PLACK_TEST_SCRIPT_NAME} . "/foo/bar%20baz%73?x=a";
},
sub {
my $env = shift;
@@ -737,8 +749,8 @@
my $cb = sub {
my $req = shift;
$req->uri->port($http_port || $port);
- if ($ENV{PLACK_TEST_PATH_PREFIX}) {
- $req->uri->path($ENV{PLACK_TEST_PATH_PREFIX} . $req->uri->path);
+ if ($ENV{PLACK_TEST_SCRIPT_NAME}) {
+ $req->uri->path($ENV{PLACK_TEST_SCRIPT_NAME} . $req->uri->path);
}
$req->header('X-Plack-Test' => $i);
return $ua->request($req);
Modified: branches/upstream/libplack-perl/current/t/FCGIUtils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/FCGIUtils.pm?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/FCGIUtils.pm (original)
+++ branches/upstream/libplack-perl/current/t/FCGIUtils.pm Mon Dec 27 16:21:35 2010
@@ -12,11 +12,6 @@
# this file is copied from Catalyst. thanks!
our @EXPORT = qw/ test_lighty_external test_fcgi_standalone /;
-
-# TODO: tesst for .fcgi
-sub test_lighty_fcgi {
-
-}
# test using FCGI::Client + FCGI External Server
sub test_fcgi_standalone {
@@ -94,6 +89,7 @@
sub _render_conf {
my ($tmpdir, $port, $fcgiport) = @_;
+ my $script_name = $ENV{PLACK_TEST_SCRIPT_NAME} || '/';
<<"END";
# basic lighttpd config file for testing fcgi(external server)+Plack
server.modules += ("mod_fastcgi")
@@ -105,7 +101,7 @@
# HTTP::Engine app specific fcgi setup
fastcgi.server = (
- "/" => ((
+ "$script_name" => ((
"check-local" => "disable",
"host" => "127.0.0.1",
"port" => $fcgiport,
Modified: branches/upstream/libplack-perl/current/t/Plack-Handler/apache2.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Handler/apache2.t?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Handler/apache2.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Handler/apache2.t Mon Dec 27 16:21:35 2010
@@ -13,7 +13,7 @@
# Note: you need to load 64bit lib to test Apache2 on OS X 10.5 or later
Plack::Test::Suite->run_server_tests(run_httpd(\&_render_conf));
-local $ENV{PLACK_TEST_PATH_PREFIX} = '/foo/bar/baz';
+local $ENV{PLACK_TEST_SCRIPT_NAME} = '/foo/bar/baz';
Plack::Test::Suite->run_server_tests( run_httpd(\&_render_conf_location),);
Plack::Test::Suite->run_server_tests( run_httpd(\&_render_conf_location_match),);
done_testing();
Modified: branches/upstream/libplack-perl/current/t/Plack-Handler/cgi.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Handler/cgi.t?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Handler/cgi.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Handler/cgi.t Mon Dec 27 16:21:35 2010
@@ -14,6 +14,7 @@
Plack::Test::Suite->runtests(sub {
my ($name, $test, $handler) = @_;
local $ENV{PLACK_TEST_HANDLER} = 'CGI';
+ local $ENV{PLACK_TEST_SCRIPT_NAME} = '/plack_test.cgi';
note $name;
my $cb = sub {
@@ -21,10 +22,15 @@
my $cgi = HTTP::Request::AsCGI->new($req);
my $c = $cgi->setup;
+
+ # Fix CGI container parameters
$ENV{SCRIPT_NAME} = '/plack_test.cgi';
+ $ENV{REQUEST_URI} = "/plack_test.cgi$ENV{REQUEST_URI}";
+
# Apache's CGI implementation does not pass "Authorization" header by untrusted ENV.
# We bow down to it under this test.
delete $ENV{HTTP_AUTHORIZATION};
+
eval { Plack::Handler::CGI->new->run($handler) };
my $res = $c->response;
$res->request($req);
Modified: branches/upstream/libplack-perl/current/t/Plack-Handler/fcgi.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Handler/fcgi.t?rev=66502&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Handler/fcgi.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Handler/fcgi.t Mon Dec 27 16:21:35 2010
@@ -10,13 +10,17 @@
my $lighty_port;
my $fcgi_port;
-test_lighty_external(
- sub {
- ($lighty_port, $fcgi_port, my $needs_fix) = @_;
- Plack::Test::Suite->run_server_tests(run_server_cb($needs_fix), $fcgi_port, $lighty_port);
- done_testing();
- }
-);
+for ('', '/fastcgi') {
+ $ENV{PLACK_TEST_SCRIPT_NAME} = $_;
+ test_lighty_external(
+ sub {
+ ($lighty_port, $fcgi_port, my $needs_fix) = @_;
+ Plack::Test::Suite->run_server_tests(run_server_cb($needs_fix), $fcgi_port, $lighty_port);
+ }
+ );
+}
+
+done_testing();
{
package Plack::Handler::FCGI::Manager;
@@ -35,8 +39,10 @@
return sub {
my($port, $app) = @_;
- note "Applying LighttpdScriptNameFix" if $needs_fix;
- $app = Plack::Middleware::LighttpdScriptNameFix->wrap($app) if $needs_fix;
+ if ($needs_fix) {
+ note "Applying LighttpdScriptNameFix";
+ $app = Plack::Middleware::LighttpdScriptNameFix->wrap($app);
+ }
$| = 0; # Test::Builder autoflushes this. reset!
More information about the Pkg-perl-cvs-commits
mailing list