r76097 - in /trunk/libhttp-parser-xs-perl: Changes META.yml README XS.xs debian/changelog debian/compat debian/control debian/copyright lib/HTTP/Parser/XS.pm lib/HTTP/Parser/XS/PP.pm t/01simple.t

fabreg-guest at users.alioth.debian.org fabreg-guest at users.alioth.debian.org
Sun Jun 19 10:38:54 UTC 2011


Author: fabreg-guest
Date: Sun Jun 19 10:38:51 2011
New Revision: 76097

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=76097
Log:
* New upstream release.
* Switch d/compat to 8.
* Add myself to Uploaders and Copyright.
* Bump to 3.9.2 Standard-Version.
* Update debhelper to (>= 8).

Modified:
    trunk/libhttp-parser-xs-perl/Changes
    trunk/libhttp-parser-xs-perl/META.yml
    trunk/libhttp-parser-xs-perl/README
    trunk/libhttp-parser-xs-perl/XS.xs
    trunk/libhttp-parser-xs-perl/debian/changelog
    trunk/libhttp-parser-xs-perl/debian/compat
    trunk/libhttp-parser-xs-perl/debian/control
    trunk/libhttp-parser-xs-perl/debian/copyright
    trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm
    trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS/PP.pm
    trunk/libhttp-parser-xs-perl/t/01simple.t

Modified: trunk/libhttp-parser-xs-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/Changes?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/Changes (original)
+++ trunk/libhttp-parser-xs-perl/Changes Sun Jun 19 10:38:51 2011
@@ -1,4 +1,7 @@
 Revision history for Perl extension HTTP::Parser::XS.
+
+0.14
+	- do not include '#' and the following characters in URI in PATH_INFO or QUERY_STRING
 
 0.13
 	- fix compile error on GCC < 3 (RT #63074)

Modified: trunk/libhttp-parser-xs-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/META.yml?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/META.yml (original)
+++ trunk/libhttp-parser-xs-perl/META.yml Sun Jun 19 10:38:51 2011
@@ -21,4 +21,4 @@
     - t
 resources:
   license: http://dev.perl.org/licenses/
-version: 0.13
+version: 0.14

Modified: trunk/libhttp-parser-xs-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/README?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/README (original)
+++ trunk/libhttp-parser-xs-perl/README Sun Jun 19 10:38:51 2011
@@ -28,7 +28,7 @@
       my %special_headers = (
         'content-length' => undef,
       );
-      my($ret, $status, $message, $headers)
+      my($ret, $minor_version, $status, $message, $headers)
         = parse_http_response($response, HEADERS_AS_ARRAYREF, \%special_headers);
 
       if($ret == -1) }

Modified: trunk/libhttp-parser-xs-perl/XS.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/XS.xs?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/XS.xs (original)
+++ trunk/libhttp-parser-xs-perl/XS.xs Sun Jun 19 10:38:51 2011
@@ -186,6 +186,7 @@
   hv_store(env, "REQUEST_URI", sizeof("REQUEST_URI") - 1,
 	   newSVpvn(path, path_len), 0);
   hv_store(env, "SCRIPT_NAME", sizeof("SCRIPT_NAME") - 1, newSVpvn("", 0), 0);
+  path_len = find_ch(path, path_len, '#'); /* strip off all text after # after storing request_uri */
   question_at = find_ch(path, path_len, '?');
   if (store_url_decoded(env, "PATH_INFO", sizeof("PATH_INFO") - 1, path,
 			question_at)

Modified: trunk/libhttp-parser-xs-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/debian/changelog?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/debian/changelog (original)
+++ trunk/libhttp-parser-xs-perl/debian/changelog Sun Jun 19 10:38:51 2011
@@ -1,3 +1,13 @@
+libhttp-parser-xs-perl (0.14-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+  * Switch d/compat to 8.
+  * Add myself to Uploaders and Copyright.
+  * Bump to 3.9.2 Standard-Version.
+  * Update debhelper to (>= 8).
+
+ -- Fabrizio Regalli <fabreg at fabreg.it>  Sun, 19 Jun 2011 12:29:14 +0200
+
 libhttp-parser-xs-perl (0.13-1) UNRELEASED; urgency=low
 
   Fixes compilation on old GCC versions

Modified: trunk/libhttp-parser-xs-perl/debian/compat
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/debian/compat?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/debian/compat (original)
+++ trunk/libhttp-parser-xs-perl/debian/compat Sun Jun 19 10:38:51 2011
@@ -1,1 +1,1 @@
-7
+8

Modified: trunk/libhttp-parser-xs-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/debian/control?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/debian/control (original)
+++ trunk/libhttp-parser-xs-perl/debian/control Sun Jun 19 10:38:51 2011
@@ -1,11 +1,12 @@
 Source: libhttp-parser-xs-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7), perl, libtest-simple-perl (>= 0.96)
+Build-Depends: debhelper (>= 8), perl, libtest-simple-perl (>= 0.96)
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Jonathan Yu <jawnsy at cpan.org>,
- gregor herrmann <gregoa at debian.org>
-Standards-Version: 3.9.1
+ gregor herrmann <gregoa at debian.org>,
+ Fabrizio Regalli <fabreg at fabreg.it>
+Standards-Version: 3.9.2
 Homepage: http://search.cpan.org/dist/HTTP-Parser-XS/
 Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libhttp-parser-xs-perl/
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libhttp-parser-xs-perl/

Modified: trunk/libhttp-parser-xs-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/debian/copyright?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/debian/copyright (original)
+++ trunk/libhttp-parser-xs-perl/debian/copyright Sun Jun 19 10:38:51 2011
@@ -22,6 +22,7 @@
 Files: debian/*
 Copyright: 2010, Jonathan Yu <jawnsy at cpan.org>
  2010, gregor herrmann <gregoa at debian.org>
+ 2011, Fabrizio Regalli <fabreg at fabreg.it>
 License: Artistic or GPL-1+
 
 License: Artistic

Modified: trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm (original)
+++ trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS.pm Sun Jun 19 10:38:51 2011
@@ -19,7 +19,7 @@
     HEADERS_AS_ARRAYREF =>2,    # Ordered ArrayRef : [ name, value, name2, value2 ... ]
 };
 
-our $VERSION = '0.13';
+our $VERSION = '0.14';
 
 our $BACKEND;
 
@@ -74,7 +74,7 @@
   my %special_headers = (
     'content-length' => undef,
   );
-  my($ret, $status, $message, $headers)
+  my($ret, $minor_version, $status, $message, $headers)
     = parse_http_response($response, HEADERS_AS_ARRAYREF, \%special_headers);
 
   if($ret == -1) }

Modified: trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS/PP.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS/PP.pm?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS/PP.pm (original)
+++ trunk/libhttp-parser-xs-perl/lib/HTTP/Parser/XS/PP.pm Sun Jun 19 10:38:51 2011
@@ -47,7 +47,7 @@
     return -1 unless $http and $http =~ /^HTTP\/1\.(\d+)$/;
     $minor = $1;
 
-    my($path, $query) = ( $uri =~ /^([^?]*)(?:\?(.*))?$/s );
+    my($path, $query) = ( $uri =~ /^([^?#]*)(?:\?([^#]*))?/s );
     # following validations are just needed to pass t/01simple.t
     if ($path =~ /%(?:[0-9a-f][^0-9a-f]|[^0-9a-f][0-9a-f])/i) {
         # invalid char in url-encoded path

Modified: trunk/libhttp-parser-xs-perl/t/01simple.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libhttp-parser-xs-perl/t/01simple.t?rev=76097&op=diff
==============================================================================
--- trunk/libhttp-parser-xs-perl/t/01simple.t (original)
+++ trunk/libhttp-parser-xs-perl/t/01simple.t Sun Jun 19 10:38:51 2011
@@ -1,4 +1,4 @@
-use Test::More tests => 13;
+use Test::More tests => 19;
 
 use HTTP::Parser::XS qw(parse_http_request);
 
@@ -98,3 +98,52 @@
 %env = ();
 is(parse_http_request($req, \%env), -1, 'partially url-encoded');
 is_deeply(\%env, {});
+
+# dumb HTTP client: https://github.com/miyagawa/Plack/issues/213
+$req = <<"EOT";
+GET /a/b#c HTTP/1.0\r
+\r
+EOT
+%env = ();
+is(parse_http_request($req, \%env), length($req), 'URI fragment');
+is_deeply(\%env, {
+    SCRIPT_NAME => '',
+    PATH_INFO   => '/a/b',
+    REQUEST_METHOD => 'GET',
+    REQUEST_URI    => '/a/b#c',
+    QUERY_STRING   => '',
+    SCRIPT_NAME     => '',
+    SERVER_PROTOCOL => 'HTTP/1.0',
+});
+
+$req = <<"EOT";
+GET /a/b%23c HTTP/1.0\r
+\r
+EOT
+%env = ();
+is(parse_http_request($req, \%env), length($req), '%23 -> #');
+is_deeply(\%env, {
+    SCRIPT_NAME => '',
+    PATH_INFO   => '/a/b#c',
+    REQUEST_METHOD => 'GET',
+    REQUEST_URI    => '/a/b%23c',
+    QUERY_STRING   => '',
+    SCRIPT_NAME     => '',
+    SERVER_PROTOCOL => 'HTTP/1.0',
+});
+
+$req = <<"EOT";
+GET /a/b?c=d#e HTTP/1.0\r
+\r
+EOT
+%env = ();
+is(parse_http_request($req, \%env), length($req), 'URI fragment after query string');
+is_deeply(\%env, {
+    SCRIPT_NAME => '',
+    PATH_INFO   => '/a/b',
+    REQUEST_METHOD => 'GET',
+    REQUEST_URI    => '/a/b?c=d#e',
+    QUERY_STRING   => 'c=d',
+    SCRIPT_NAME     => '',
+    SERVER_PROTOCOL => 'HTTP/1.0',
+});




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