r48036 - in /branches/upstream/libhttp-request-ascgi-perl/current: Changes MANIFEST META.yml Makefile.PL README dist.ini lib/HTTP/Request/AsCGI.pm t/05env.t t/release-pod-coverage.t t/release-pod-syntax.t

eloy at users.alioth.debian.org eloy at users.alioth.debian.org
Tue Dec 1 10:24:59 UTC 2009


Author: eloy
Date: Tue Dec  1 10:24:50 2009
New Revision: 48036

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=48036
Log:
[svn-upgrade] Integrating new upstream version, libhttp-request-ascgi-perl (1.0)

Added:
    branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-coverage.t
    branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-syntax.t
Modified:
    branches/upstream/libhttp-request-ascgi-perl/current/Changes
    branches/upstream/libhttp-request-ascgi-perl/current/MANIFEST
    branches/upstream/libhttp-request-ascgi-perl/current/META.yml
    branches/upstream/libhttp-request-ascgi-perl/current/Makefile.PL
    branches/upstream/libhttp-request-ascgi-perl/current/README
    branches/upstream/libhttp-request-ascgi-perl/current/dist.ini
    branches/upstream/libhttp-request-ascgi-perl/current/lib/HTTP/Request/AsCGI.pm
    branches/upstream/libhttp-request-ascgi-perl/current/t/05env.t

Modified: branches/upstream/libhttp-request-ascgi-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/Changes?rev=48036&op=diff
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/Changes (original)
+++ branches/upstream/libhttp-request-ascgi-perl/current/Changes Tue Dec  1 10:24:50 2009
@@ -1,4 +1,8 @@
 This file documents the revision history for Perl extension HTTP::Request::AsCGI.
+
+1.0
+    - Change how PATH_INFO is decoded so that everything is decoded, including
+      URI reserved characters (RT#50082)
 
 0.9 2009-04-27
     - unescape PATH_INFO more safely

Modified: branches/upstream/libhttp-request-ascgi-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/MANIFEST?rev=48036&op=diff
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/MANIFEST (original)
+++ branches/upstream/libhttp-request-ascgi-perl/current/MANIFEST Tue Dec  1 10:24:50 2009
@@ -14,4 +14,6 @@
 t/05env.t
 t/06response.t
 t/07forking.t
-t/08error.t
+t/08error.t
+t/release-pod-coverage.t
+t/release-pod-syntax.t

Modified: branches/upstream/libhttp-request-ascgi-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/META.yml?rev=48036&op=diff
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/META.yml (original)
+++ branches/upstream/libhttp-request-ascgi-perl/current/META.yml Tue Dec  1 10:24:50 2009
@@ -1,17 +1,20 @@
 ---
-abstract: Set up a CGI environment from an HTTP::Request
+abstract: 'Set up a CGI environment from an HTTP::Request'
 author:
-- Christian Hansen <ch at ngmedia.com>
-- Hans Dieter Pearcey <hdp at cpan.org>
-generated_by: Dist::Zilla::Plugin::MetaYaml version 1.007
+  - 'Christian Hansen <ch at ngmedia.com>'
+  - 'Hans Dieter Pearcey <hdp at cpan.org>'
+generated_by: 'Dist::Zilla version 1.093290'
 license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
 name: HTTP-Request-AsCGI
 requires:
-  Carp: '0'
-  Class::Accessor: '0'
-  HTTP::Request: '0'
-  HTTP::Response: '1.53'
-  IO::File: '0'
-  Test::More: '0'
-  URI::Escape: '0'
-version: '0.9'
+  Carp: 0
+  Class::Accessor: 0
+  HTTP::Request: 0
+  HTTP::Response: 1.53
+  IO::File: 0
+  Test::More: 0
+  URI::Escape: 0
+version: 1.0

Modified: branches/upstream/libhttp-request-ascgi-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/Makefile.PL?rev=48036&op=diff
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/Makefile.PL (original)
+++ branches/upstream/libhttp-request-ascgi-perl/current/Makefile.PL Tue Dec  1 10:24:50 2009
@@ -1,17 +1,19 @@
 
 use strict;
 use warnings;
+
+
 
 use ExtUtils::MakeMaker;
 
 WriteMakefile(
   DISTNAME  => 'HTTP-Request-AsCGI',
   NAME      => 'HTTP::Request::AsCGI',
-  AUTHOR    => 'Christian\ Hansen\ \<ch\@ngmedia\.com\>\,\ Hans\ Dieter\ Pearcey\ \<hdp\@cpan\.org\>',
-  ABSTRACT  => 'Set up a CGI environment from an HTTP::Request',
-  VERSION   => '0.9',
+  AUTHOR    => "Christian\ Hansen\ \<ch\@ngmedia\.com\>\,\ Hans\ Dieter\ Pearcey\ \<hdp\@cpan\.org\>",
+  ABSTRACT  => "Set\ up\ a\ CGI\ environment\ from\ an\ HTTP\:\:Request",
+  VERSION   => '1.0',
   EXE_FILES => [ qw() ],
-  (eval { ExtUtils::MakeMaker->VERSION(6.21) } ? (LICENSE => 'perl') : ()),
+  (eval { ExtUtils::MakeMaker->VERSION(6.31) } ? (LICENSE => 'perl') : ()),
   PREREQ_PM    => {
     "Test::More" => '0',
     "IO::File" => '0',
@@ -21,4 +23,6 @@
     "HTTP::Request" => '0',
     "Carp" => '0',
   },
+  test => {TESTS => 't/*.t'}
 );
+

Modified: branches/upstream/libhttp-request-ascgi-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/README?rev=48036&op=diff
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/README (original)
+++ branches/upstream/libhttp-request-ascgi-perl/current/README Tue Dec  1 10:24:50 2009
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution HTTP-Request-AsCGI, version
-0.9:
+1.0:
 
   Set up a CGI environment from an HTTP::Request
 

Modified: branches/upstream/libhttp-request-ascgi-perl/current/dist.ini
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/dist.ini?rev=48036&op=diff
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/dist.ini (original)
+++ branches/upstream/libhttp-request-ascgi-perl/current/dist.ini Tue Dec  1 10:24:50 2009
@@ -1,5 +1,5 @@
 name = HTTP-Request-AsCGI
-version = 0.9
+version = 1.0
 license = Perl_5
 author  = Christian Hansen <ch at ngmedia.com>
 author  = Hans Dieter Pearcey <hdp at cpan.org>

Modified: branches/upstream/libhttp-request-ascgi-perl/current/lib/HTTP/Request/AsCGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/lib/HTTP/Request/AsCGI.pm?rev=48036&op=diff
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/lib/HTTP/Request/AsCGI.pm (original)
+++ branches/upstream/libhttp-request-ascgi-perl/current/lib/HTTP/Request/AsCGI.pm Tue Dec  1 10:24:50 2009
@@ -1,11 +1,11 @@
 package HTTP::Request::AsCGI;
-our $VERSION = '0.9';
-
 # ABSTRACT: Set up a CGI environment from an HTTP::Request
 use strict;
 use warnings;
 use bytes;
 use base 'Class::Accessor::Fast';
+
+our $VERSION = '1.0';
 
 use Carp;
 use HTTP::Response;
@@ -23,8 +23,8 @@
 my %reserved = map { sprintf('%02x', ord($_)) => 1 } split //, $URI::reserved;
 sub _uri_safe_unescape {
     my ($s) = @_;
-    $s =~ s/%([a-fA-F0-9]{2})/$reserved{lc($1)} ? "%$1" : chr(hex($1))/ge;
-    $s;
+    $s =~ s/%([a-fA-F0-9]{2})/$reserved{lc($1)} ? "%$1" : pack('C', hex($1))/ge;
+    $s
 }
 
 sub new {
@@ -53,7 +53,7 @@
         GATEWAY_INTERFACE => 'CGI/1.1',
         HTTP_HOST         => $uri->host_port,
         HTTPS             => ( $uri->scheme eq 'https' ) ? 'ON' : 'OFF',  # not in RFC 3875
-        PATH_INFO         => _uri_safe_unescape($uri->path),
+        PATH_INFO         => $uri->path,
         QUERY_STRING      => $uri->query || '',
         SCRIPT_NAME       => '/',
         SERVER_NAME       => $uri->host,
@@ -68,6 +68,13 @@
         @_
     };
 
+    # RFC 3875 says PATH_INFO is not URI-encoded. That's really
+    # annoying for applications that you can't tell "%2F" vs "/", but
+    # doing the partial decoding then makes it impossible to tell
+    # "%252F" vs "%2F". Encoding everything is more compatible to what
+    # web servers like Apache or lighttpd do, anyways.
+    $environment->{PATH_INFO} = URI::Escape::uri_unescape($environment->{PATH_INFO});
+
     foreach my $field ( $request->headers->header_field_names ) {
 
         my $key = uc("HTTP_$field");
@@ -296,41 +303,43 @@
 
 =head1 VERSION
 
-version 0.9
+version 1.0
 
 =begin Pod::Coverage
 
-    enviroment
+  enviroment
 
 =end Pod::Coverage
 
+
+
 =head1 SYNOPSIS
 
-      use CGI;
-      use HTTP::Request;
-      use HTTP::Request::AsCGI;
-
-      my $request = HTTP::Request->new( GET => 'http://www.host.com/' );
-      my $stdout;
-
-      {
-          my $c = HTTP::Request::AsCGI->new($request)->setup;
-          my $q = CGI->new;
-
-          print $q->header,
-                $q->start_html('Hello World'),
-                $q->h1('Hello World'),
-                $q->end_html;
-
-          $stdout = $c->stdout;
-
-          # environment and descriptors will automatically be restored
-          # when $c is destructed.
-      }
-
-      while ( my $line = $stdout->getline ) {
-          print $line;
-      }
+    use CGI;
+    use HTTP::Request;
+    use HTTP::Request::AsCGI;
+
+    my $request = HTTP::Request->new( GET => 'http://www.host.com/' );
+    my $stdout;
+
+    {
+        my $c = HTTP::Request::AsCGI->new($request)->setup;
+        my $q = CGI->new;
+
+        print $q->header,
+              $q->start_html('Hello World'),
+              $q->h1('Hello World'),
+              $q->end_html;
+
+        $stdout = $c->stdout;
+
+        # environment and descriptors will automatically be restored
+        # when $c is destructed.
+    }
+
+    while ( my $line = $stdout->getline ) {
+        print $line;
+    }
 
 =head1 DESCRIPTION
 
@@ -399,6 +408,8 @@
 
 Thomas L. Shinnick for his valuable win32 testing.
 
+
+
 =head1 AUTHORS
 
   Christian Hansen <ch at ngmedia.com>

Modified: branches/upstream/libhttp-request-ascgi-perl/current/t/05env.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/t/05env.t?rev=48036&op=diff
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/t/05env.t (original)
+++ branches/upstream/libhttp-request-ascgi-perl/current/t/05env.t Tue Dec  1 10:24:50 2009
@@ -7,9 +7,15 @@
 
 use HTTP::Request;
 use HTTP::Request::AsCGI;
+use Encode;
 
 my $r = HTTP::Request->new( GET => 'http://www.host.com/cgi-bin/script.cgi/my%20path%2F?a=1&b=2', [ 'X-Test' => 'Test' ] );
-my %e = ( SCRIPT_NAME => '/cgi-bin/script.cgi' );
+my %e = (
+  SCRIPT_NAME => '/cgi-bin/script.cgi',
+# test a utf-8 PATH_INFO, sort of (and safe decoding)
+  PATH_INFO =>
+  '/foo%2F%C3%90%C2%91%C3%90%C2%AF%C3%A9%C2%99%C2%B0%C3%A8%C2%8C%C2%8E',
+);
 my $c = HTTP::Request::AsCGI->new( $r, %e );
 $c->stdout(undef);
 
@@ -18,7 +24,7 @@
 is( $ENV{GATEWAY_INTERFACE}, 'CGI/1.1', 'GATEWAY_INTERFACE' );
 is( $ENV{HTTP_HOST}, 'www.host.com:80', 'HTTP_HOST' );
 is( $ENV{HTTP_X_TEST}, 'Test', 'HTTP_X_TEST' );
-is( $ENV{PATH_INFO}, '/my path%2F', 'PATH_INFO' );
+is( decode('UTF-8', $ENV{PATH_INFO}), '/foo/БЯ陰茎', 'PATH_INFO');
 is( $ENV{QUERY_STRING}, 'a=1&b=2', 'QUERY_STRING' );
 is( $ENV{SCRIPT_NAME}, '/cgi-bin/script.cgi', 'SCRIPT_NAME' );
 is( $ENV{REQUEST_METHOD}, 'GET', 'REQUEST_METHOD' );

Added: branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-coverage.t?rev=48036&op=file
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-coverage.t (added)
+++ branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-coverage.t Tue Dec  1 10:24:50 2009
@@ -1,0 +1,21 @@
+#!perl
+
+BEGIN {
+  unless ($ENV{RELEASE_TESTING}) {
+    require Test::More;
+    Test::More::plan(skip_all => 'these tests are for release candidate testing');
+  }
+}
+
+
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.08";
+plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage"
+  if $@;
+
+eval "use Pod::Coverage::TrustPod";
+plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage"
+  if $@;
+
+all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' });

Added: branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-syntax.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-syntax.t?rev=48036&op=file
==============================================================================
--- branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-syntax.t (added)
+++ branches/upstream/libhttp-request-ascgi-perl/current/t/release-pod-syntax.t Tue Dec  1 10:24:50 2009
@@ -1,0 +1,15 @@
+#!perl
+
+BEGIN {
+  unless ($ENV{RELEASE_TESTING}) {
+    require Test::More;
+    Test::More::plan(skip_all => 'these tests are for release candidate testing');
+  }
+}
+
+use Test::More;
+
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+
+all_pod_files_ok();




More information about the Pkg-perl-cvs-commits mailing list