[Rt-commit] r4505 - in HTTP-Server-Simple: .

jesse at bestpractical.com jesse at bestpractical.com
Wed Feb 8 21:35:26 EST 2006


Author: jesse
Date: Wed Feb  8 21:35:25 2006
New Revision: 4505

Modified:
   HTTP-Server-Simple/   (props changed)
   HTTP-Server-Simple/Changes
   HTTP-Server-Simple/META.yml
   HTTP-Server-Simple/SIGNATURE
   HTTP-Server-Simple/lib/HTTP/Server/Simple.pm

Log:
 r23516 at truegrounds:  jesse | 2006-02-08 21:25:10 -0500
 * 0.18. Patch from chris dent to let subclasses support more verbs


Modified: HTTP-Server-Simple/Changes
==============================================================================
--- HTTP-Server-Simple/Changes	(original)
+++ HTTP-Server-Simple/Changes	Wed Feb  8 21:35:25 2006
@@ -1,3 +1,12 @@
+0.18
+
+  new method: valid_http_method() from Chris Dent to make it easier to 
+  create servers handling non-standard HTTP verbs.
+
+0.17
+  Workaround for Class::Spiffy classloading order issue
+  Better handling for completely mangled requests.
+
 0.16 Mon Nov  7 14:40:43 EST 2005
 
   SIG{'HUP'} does not exist on Win32 (cpan #15606)

Modified: HTTP-Server-Simple/META.yml
==============================================================================
--- HTTP-Server-Simple/META.yml	(original)
+++ HTTP-Server-Simple/META.yml	Wed Feb  8 21:35:25 2006
@@ -1,12 +1,13 @@
-name: HTTP-Server-Simple
-version: 0.16
-license: perl
 distribution_type: module
-requires:
-  Socket: 0
-  Test::More: 0
-  CGI: 0
+generated_by: Module::Install version 0.52
+license: perl
+name: HTTP-Server-Simple
 no_index:
   directory:
     - inc
-generated_by: Module::Install version 0.37
+    - t
+requires:
+  CGI: 0
+  Socket: 0
+  Test::More: 0
+version: 0.18

Modified: HTTP-Server-Simple/SIGNATURE
==============================================================================
--- HTTP-Server-Simple/SIGNATURE	(original)
+++ HTTP-Server-Simple/SIGNATURE	Wed Feb  8 21:35:25 2006
@@ -14,23 +14,23 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-SHA1 26bb64f3864e5f6784401a38e226aa1ddd73edde Changes
+SHA1 5fb9209da2f06d0bf15387dafcac44f8c53aa06f Changes
 SHA1 0ac508c50476dcc2bf8fe3094cb341425291e1ee MANIFEST
-SHA1 ecbd933c6b8e7d47e41fc16c3f21c8df92fa2c3f META.yml
+SHA1 51a91151f855b6d04d73b0611ab2d3c498bfa1c7 META.yml
 SHA1 490f3fd115e09cb05b725580e5ed5cdd58241049 Makefile.PL
 SHA1 ed0c107672daac3bc9e266876666e1059dbe44b7 README
 SHA1 4ea1e9072ca87399184a46233df52a21e285604d ex/sample_server
-SHA1 842ab7e28834effb9e4222aab72c4106727dea0f inc/Module/Install.pm
-SHA1 1da4fc271065900f73682f31d4f9c0dae5288143 inc/Module/Install/Base.pm
-SHA1 0d0b6772bd5ec750e99d238942c88329e394d48d inc/Module/Install/Can.pm
+SHA1 e8ed0773fed846d6f5480bf3bf1735c2d551da63 inc/Module/Install.pm
+SHA1 9dbed9ff1790473ec3136a606f062fa050326c43 inc/Module/Install/Base.pm
+SHA1 d37430abee4687a4861b1312e5bea6953e6afe4d inc/Module/Install/Can.pm
 SHA1 a784ba7d2b096084b2ffed3a7d853e2847f4dedb inc/Module/Install/Fetch.pm
-SHA1 dc2af04175831ddb9a00de944e761e5c46bbf283 inc/Module/Install/Makefile.pm
-SHA1 421da5922ad85b72ae5b27c33803e86b3762d238 inc/Module/Install/Metadata.pm
+SHA1 044cd2f160364fe36eca2ba35e16e7cf46c79138 inc/Module/Install/Makefile.pm
+SHA1 49e0d839edeb0f3e9af12fd2444b98365393a23e inc/Module/Install/Metadata.pm
 SHA1 2a1b494a7e5adaa3216e86d909dd5bf87d084c80 inc/Module/Install/Win32.pm
-SHA1 c92e1d32922615347e059e7e3a2f53b5e9c98e3b inc/Module/Install/WriteAll.pm
-SHA1 f6b00458452368320b19750392487cf1e8515c1b lib/HTTP/Server/Simple.pm
+SHA1 4a23fafe534363a99f0d936df9086ad243e692c9 inc/Module/Install/WriteAll.pm
+SHA1 6c1a08a64406bdf937a0996d1803286df7a223f6 lib/HTTP/Server/Simple.pm
 SHA1 2d7348b166f654a460ddae4cb4183f4a544c85fc lib/HTTP/Server/Simple/CGI.pm
-SHA1 b2c2d007a7f50058c874e633d15fb621b2bfc394 lib/HTTP/Server/Simple/CGI/Environment.pm
+SHA1 27c4b8c97f00d3427a320c8087e2b77b128a1992 lib/HTTP/Server/Simple/CGI/Environment.pm
 SHA1 db064af54cab345a71daec576e32e64b8fb1033d t/00smoke.t
 SHA1 9e68bffc26b5a42e2785ec68c3bf6fe45d6bb6da t/01live.t
 SHA1 aca95653cfce68912e08c57b3a4566207e2f99b3 t/02pod.t
@@ -39,7 +39,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.1 (GNU/Linux)
 
-iD8DBQFDb63XEi9d9xCOQEYRArQVAJ44Bkj2jqybBIr71mclQ0aOi/u2cgCgkakh
-e210lVUgdouYs0xX1F+CElo=
-=odXJ
+iD8DBQFD6qfhEi9d9xCOQEYRAjyLAKCLKcijRrqA9NW7JZkfnOVlHuxifwCeMZuU
+nrm1Jro4k1y4NyyOj9r7ee8=
+=K+Ut
 -----END PGP SIGNATURE-----

Modified: HTTP-Server-Simple/lib/HTTP/Server/Simple.pm
==============================================================================
--- HTTP-Server-Simple/lib/HTTP/Server/Simple.pm	(original)
+++ HTTP-Server-Simple/lib/HTTP/Server/Simple.pm	Wed Feb  8 21:35:25 2006
@@ -5,7 +5,7 @@
 use Socket;
 use Carp;
 
-our $VERSION = '0.16';
+our $VERSION = '0.18';
 
 =head1 NAME
 
@@ -288,18 +288,18 @@
         my $peeraddr = inet_ntoa($iaddr) || "127.0.0.1";
 
         my ( $method, $request_uri, $proto ) = $self->parse_request;
-        unless ($method) { $self->bad_request; return };
+        
+        
+        unless ($self->valid_http_method($method) ) {
+            $self->bad_request;
+            return;
+        }
 
         $proto ||= "HTTP/0.9";
 
         my ( $file, $query_string )
             = ( $request_uri =~ /([^?]*)(?:\?(.*))?/ );    # split at ?
 
-        if ( $method !~ /^(?:GET|POST|HEAD)$/ ) {
-            $self->bad_request;
-            return;
-        }
-
         $self->setup(
             method       => $method,
             protocol     => $proto,
@@ -603,9 +603,22 @@
         length($bad_request_doc), "\r\n\r\n", $bad_request_doc;
 }
 
+=head2 valid_http_method($method)
+
+Given a candidate HTTP method in $method, determine if it is valid.
+Override if, for example, you'd like to do some WebDAV.
+
+=cut 
+
+sub valid_http_method {
+    my $self   = shift;
+    my $method = shift;
+    return $method =~ /^(?:GET|POST|HEAD|PUT|DELETE)$/;
+}
+
 =head1 AUTHOR
 
-Copyright (c) 2004-2005 Jesse Vincent, <jesse at bestpractical.com>.
+Copyright (c) 2004-2006 Jesse Vincent, <jesse at bestpractical.com>.
 All rights reserved.
 
 Marcus Ramberg <drave at thefeed.no> contributed tests, cleanup, etc


More information about the Rt-commit mailing list