r57562 - in /branches/upstream/libplack-perl/current: ./ lib/ lib/Plack/ lib/Plack/App/ lib/Plack/Handler/ lib/Plack/Middleware/ lib/Plack/Server/ t/Plack-Handler/ t/Plack-Middleware/ t/Plack-Server/
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Thu May 6 12:56:37 UTC 2010
Author: jawnsy-guest
Date: Thu May 6 12:55:15 2010
New Revision: 57562
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57562
Log:
[svn-upgrade] Integrating new upstream version, libplack-perl (0.9935)
Modified:
branches/upstream/libplack-perl/current/Changes
branches/upstream/libplack-perl/current/META.yml
branches/upstream/libplack-perl/current/README
branches/upstream/libplack-perl/current/lib/Plack.pm
branches/upstream/libplack-perl/current/lib/Plack/App/File.pm
branches/upstream/libplack-perl/current/lib/Plack/Handler/CGI.pm
branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.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/t/Plack-Handler/cgi.t
branches/upstream/libplack-perl/current/t/Plack-Middleware/order.t
branches/upstream/libplack-perl/current/t/Plack-Middleware/prefix.t
branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace.t
branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_force.t
branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_utf8.t
branches/upstream/libplack-perl/current/t/Plack-Server/compat.t
Modified: branches/upstream/libplack-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/Changes?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/Changes (original)
+++ branches/upstream/libplack-perl/current/Changes Thu May 6 12:55:15 2010
@@ -1,6 +1,15 @@
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.9935 Wed May 5 15:17:06 PDT 2010
+ - Set an empty PATH_INFO if CGI environment doesn't set so (hachi) #109
+ - Fixed a possible weird combination of SCRIPT_NAME and PATH_INFO in CGI handlers
+ - localize PATH_INFO and SCRIPT_NAME in App::File and subclasses #100
+ - updated COPYRIGHT notice for Debian
+ - Middleware::StackTrace now displays text trace to psgi.errors like Rack::ShowExceptions
+ (castaway, theorbtwo)
+ - Middleware::StackTrace: Fixed the text stack trace format to be more readable
0.9934 Tue May 4 15:47:33 PDT 2010
- Added a test in CGIBin where binmode ":utf8" causes bad content-length #110
Modified: branches/upstream/libplack-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/META.yml?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/META.yml (original)
+++ branches/upstream/libplack-perl/current/META.yml Thu May 6 12:55:15 2010
@@ -38,4 +38,4 @@
resources:
license: http://dev.perl.org/licenses/
repository: git://github.com/miyagawa/Plack.git
-version: 0.9934
+version: 0.9935
Modified: branches/upstream/libplack-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/README?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/README (original)
+++ branches/upstream/libplack-perl/current/README Thu May 6 12:55:15 2010
@@ -129,6 +129,9 @@
Tatsuhiko Miyagawa
COPYRIGHT
+ The following copyright notice applies to all the files provided in this
+ distribution, including binary files, unless explicitly noted otherwise.
+
Copyright 2009-2010 Tatsuhiko Miyagawa
CONTRIBUTORS
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=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack.pm Thu May 6 12:55:15 2010
@@ -3,7 +3,7 @@
use strict;
use warnings;
use 5.008_001;
-our $VERSION = '0.9934';
+our $VERSION = '0.9935';
$VERSION = eval $VERSION;
1;
@@ -166,6 +166,10 @@
=head1 COPYRIGHT
+The following copyright notice applies to all the files provided in
+this distribution, including binary files, unless explicitly noted
+otherwise.
+
Copyright 2009-2010 Tatsuhiko Miyagawa
=head1 CONTRIBUTORS
Modified: branches/upstream/libplack-perl/current/lib/Plack/App/File.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/App/File.pm?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/App/File.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/App/File.pm Thu May 6 12:55:15 2010
@@ -22,13 +22,15 @@
my($file, $path_info) = $self->file || $self->locate_file($env);
return $file if ref $file eq 'ARRAY';
+ local @{$env}{qw( SCRIPT_NAME PATH_INFO )} = @{$env}{qw( SCRIPT_NAME PATH_INFO )};
+
if ($path_info) {
$env->{PATH_INFO} =~ s/\Q$path_info\E$//;
$env->{SCRIPT_NAME} = $env->{SCRIPT_NAME} . $env->{PATH_INFO};
- $env->{PATH_INFO } = $path_info;
+ $env->{PATH_INFO} = $path_info;
} else {
$env->{SCRIPT_NAME} = $env->{SCRIPT_NAME} . $env->{PATH_INFO};
- $env->{PATH_INFO } = '';
+ $env->{PATH_INFO} = '';
}
return $self->serve_path($env, $file);
Modified: branches/upstream/libplack-perl/current/lib/Plack/Handler/CGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Handler/CGI.pm?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Handler/CGI.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Handler/CGI.pm Thu May 6 12:55:15 2010
@@ -23,8 +23,16 @@
delete $env->{HTTP_CONTENT_TYPE};
delete $env->{HTTP_CONTENT_LENGTH};
- $env->{SCRIPT_NAME} = '' if $env->{SCRIPT_NAME} eq '/';
$env->{'HTTP_COOKIE'} ||= $ENV{COOKIE}; # O'Reilly server bug
+
+ if (!exists $env->{PATH_INFO}) {
+ $env->{PATH_INFO} = '';
+ }
+
+ if ($env->{SCRIPT_NAME} eq '/') {
+ $env->{SCRIPT_NAME} = '';
+ $env->{PATH_INFO} = '/' . $env->{PATH_INFO};
+ }
my $res = $app->($env);
if (ref $res eq 'ARRAY') {
Modified: branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm Thu May 6 12:55:15 2010
@@ -5,7 +5,7 @@
use Devel::StackTrace;
use Devel::StackTrace::AsHTML;
use Try::Tiny;
-use Plack::Util::Accessor qw( force );
+use Plack::Util::Accessor qw( force no_print_errors );
our $StackTraceClass = "Devel::StackTrace";
@@ -26,11 +26,13 @@
my $caught;
my $res = try { $self->app->($env) } catch { $caught = $_ };
- if ($trace && ($caught || $self->{force} && ref $res eq 'ARRAY' && $res->[0] == 500) ) {
+ if ($trace && ($caught || ($self->force && ref $res eq 'ARRAY' && $res->[0] == 500)) ) {
+ my $text = trace_as_string($trace);
+ $env->{'psgi.errors'}->print($text) unless $self->no_print_errors;
if (($env->{HTTP_ACCEPT} || '*/*') =~ /html/) {
$res = [500, ['Content-Type' => 'text/html; charset=utf-8'], [ utf8_safe($trace->as_html) ]];
} else {
- $res = [500, ['Content-Type' => 'text/plain; charset=utf-8'], [ utf8_safe($trace->as_string) ]];
+ $res = [500, ['Content-Type' => 'text/plain; charset=utf-8'], [ utf8_safe($text) ]];
}
}
@@ -40,6 +42,21 @@
undef $trace;
return $res;
+}
+
+sub trace_as_string {
+ my $trace = shift;
+
+ my $st = '';
+ my $first = 1;
+ foreach my $f ( $trace->frames() ) {
+ $st .= "\t" unless $first;
+ $st .= $f->as_string($first) . "\n";
+ $first = 0;
+ }
+
+ return $st;
+
}
sub utf8_safe {
@@ -106,6 +123,15 @@
code. This option enforces the middleware to display stack trace even
if it's not the direct error thrown by the application.
+=item no_print_errors
+
+ enable "StackTrace", no_print_errors => 1;
+
+Skips printing the text stacktrace to console
+(C<psgi.errors>). Defaults to 0, which means the text version of the
+stack trace error is printed to the errors handle, which usually is a
+standard error.
+
=back
=head1 AUTHOR
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=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Request.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Request.pm Thu May 6 12:55:15 2010
@@ -2,7 +2,7 @@
use strict;
use warnings;
use 5.008_001;
-our $VERSION = '0.9934';
+our $VERSION = '0.9935';
$VERSION = eval $VERSION;
use HTTP::Headers;
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=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Response.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Response.pm Thu May 6 12:55:15 2010
@@ -1,7 +1,7 @@
package Plack::Response;
use strict;
use warnings;
-our $VERSION = '0.9934';
+our $VERSION = '0.9935';
$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=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm Thu May 6 12:55:15 2010
@@ -1,6 +1,6 @@
package Plack::Server::ServerSimple;
use strict;
-our $VERSION = '0.9934';
+our $VERSION = '0.9935';
$VERSION = eval $VERSION;
use parent qw(Plack::Handler::HTTP::Server::Simple);
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=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Handler/cgi.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Handler/cgi.t Thu May 6 12:55:15 2010
@@ -20,6 +20,7 @@
my $cgi = HTTP::Request::AsCGI->new($req);
my $c = $cgi->setup;
+ $ENV{SCRIPT_NAME} = '/plack_test.cgi';
eval { Plack::Handler::CGI->new->run($handler) };
my $res = $c->response;
$res->request($req);
Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/order.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/order.t?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/order.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/order.t Thu May 6 12:55:15 2010
@@ -10,7 +10,8 @@
};
};
-my $res = $handler->(+{});
+open my $io, ">", \my $err;
+my $res = $handler->({ 'psgi.errors' => $io });
is $res->[0], 500;
my %hdrs = @{$res->[1]};
Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/prefix.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/prefix.t?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/prefix.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/prefix.t Thu May 6 12:55:15 2010
@@ -10,7 +10,8 @@
};
};
-my $res = $handler->(+{});
+open my $io, ">", \my $err;
+my $res = $handler->({ 'psgi.errors' => $io });
is $res->[0], 500;
my %hdrs = @{$res->[1]};
Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace.t?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace.t Thu May 6 12:55:15 2010
@@ -5,7 +5,7 @@
use Plack::Test;
use HTTP::Request::Common;
-my $app = Plack::Middleware::StackTrace->wrap(sub { die "orz" });
+my $app = Plack::Middleware::StackTrace->wrap(sub { die "orz" }, no_print_errors => 1);
test_psgi $app, sub {
my $cb = shift;
Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_force.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_force.t?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_force.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_force.t Thu May 6 12:55:15 2010
@@ -11,7 +11,7 @@
return [ 500, [ 'Content-Type', 'text/html' ], [ "Fancy Error" ] ];
};
-my $default_app = Plack::Middleware::StackTrace->wrap($app);
+my $default_app = Plack::Middleware::StackTrace->wrap($app, no_print_errors => 1);
test_psgi $default_app, sub {
my $cb = shift;
@@ -23,7 +23,7 @@
like $res->content, qr/Fancy Error/;
};
-my $force_app = Plack::Middleware::StackTrace->wrap($app, force => 1);
+my $force_app = Plack::Middleware::StackTrace->wrap($app, force => 1, no_print_errors => 1);
test_psgi $force_app, sub {
my $cb = shift;
Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_utf8.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_utf8.t?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_utf8.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace_utf8.t Thu May 6 12:55:15 2010
@@ -7,7 +7,7 @@
use HTTP::Request::Common;
$Plack::Test::Impl = "Server";
-my $app = Plack::Middleware::StackTrace->wrap(sub { die "Foo \x{30c6}" });
+my $app = Plack::Middleware::StackTrace->wrap(sub { die "Foo \x{30c6}" }, no_print_errors => 1);
test_psgi $app, sub {
my $cb = shift;
Modified: branches/upstream/libplack-perl/current/t/Plack-Server/compat.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Server/compat.t?rev=57562&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Server/compat.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Server/compat.t Thu May 6 12:55:15 2010
@@ -14,6 +14,7 @@
my $req = HTTP::Request->new(GET => "http://localhost/foo");
my $cgi = HTTP::Request::AsCGI->new($req);
my $c = $cgi->setup;
+$ENV{SCRIPT_NAME} = '/plack_test.cgi';
my $stderr;
{
More information about the Pkg-perl-cvs-commits
mailing list