[Rt-commit] r2506 - in HTTP-Server-Simple: . lib/HTTP/Server lib/HTTP/Server/Simple

jesse at bestpractical.com jesse at bestpractical.com
Sat Mar 26 01:18:52 EST 2005


Author: jesse
Date: Sat Mar 26 01:18:50 2005
New Revision: 2506

Modified:
   HTTP-Server-Simple/   (props changed)
   HTTP-Server-Simple/Changes
   HTTP-Server-Simple/lib/HTTP/Server/Simple.pm
   HTTP-Server-Simple/lib/HTTP/Server/Simple/CGI.pm
Log:
 r10144 at hualien:  jesse | 2005-03-26 14:16:22 +0800
 * Removed outdated docs
 * Fixed an %ENV setup bug
 


Modified: HTTP-Server-Simple/Changes
==============================================================================
--- HTTP-Server-Simple/Changes	(original)
+++ HTTP-Server-Simple/Changes	Sat Mar 26 01:18:50 2005
@@ -1,6 +1,10 @@
+0.05 Sat Mar 26 14:14:54 CST 2005
+
+- Fix a bug in HTTP::Server::Simple::CGI that clobbered CGI ENV variables
+  in some cases. Thanks, Hide.
 - New public subclass-overridable method ->net_server() that can
   optionally take a Net::Server subclass name and use it to replace
-  the default ->run() method.
+  the default ->run() method. -- Autrijus Tang
 
 0.04 Tue Mar 22 23:34:36 CST 2005
 - Changed ->headers calling conventions. This may break backwards compat,

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	Sat Mar 26 01:18:50 2005
@@ -342,14 +342,6 @@
   peername     Remote name           "200.2.4.5", "foo.com"
   peeraddr     Remote address        "200.2.4.5", "::1"
   localname    Local interface       "localhost", "myhost.com"
-  headers      All HTTP/1.0+ headers  (see below)
-
-The C<headers> method contains I<all> HTTP headers, in order, without
-being parsed.  It is up to the sub-class to either grok them or ignore
-them.
-
-Note that if the client is a HTTP/0.9 client, then there will be no
-headers at all.
 
 =cut
 

Modified: HTTP-Server-Simple/lib/HTTP/Server/Simple/CGI.pm
==============================================================================
--- HTTP-Server-Simple/lib/HTTP/Server/Simple/CGI.pm	(original)
+++ HTTP-Server-Simple/lib/HTTP/Server/Simple/CGI.pm	Sat Mar 26 01:18:50 2005
@@ -41,7 +41,7 @@
 
 =cut
 
-sub post_setup_hook{
+sub post_setup_hook {
 
     $ENV{SERVER_URL} ||=
 	("http://".$ENV{SERVER_NAME}.":".$ENV{SERVER_PORT}."/");
@@ -50,9 +50,11 @@
 
 =head2 setup
 
-This method sets up environment variables based on various
+This method sets up CGI environment variables based on various
 meta-headers, like the protocol, remote host name, request path, etc.
 
+See the docs in L<HTTP::Server::Simple> for more detail.
+
 =cut
 
 our %env_mapping =
@@ -71,10 +73,14 @@
     no warnings 'uninitialized';
     my $self = shift;
 
+    # XXX TODO: rather than clone functionality from the base class,
+    # we should call super
+    #
     while ( my ($item, $value) = splice @_, 0, 2 ) {
 	if ( $self->can($item) ) {
 	    $self->$item($value);
-	} elsif ( my $k = $env_mapping{$item} ) {
+	} 
+        if ( my $k = $env_mapping{$item} ) {
 	    $ENV{$k} = $value;
 	}
     }


More information about the Rt-commit mailing list