[Bps-public-commit] r12813 - in HTTP-Server-Simple: .

sartak at bestpractical.com sartak at bestpractical.com
Mon Jun 2 17:04:39 EDT 2008


Author: sartak
Date: Mon Jun  2 17:04:39 2008
New Revision: 12813

Modified:
   HTTP-Server-Simple/   (props changed)
   HTTP-Server-Simple/lib/HTTP/Server/Simple.pm

Log:
 r61434 at onn:  sartak | 2008-06-02 17:04:32 -0400
 Clear %ENV before every request when using Net::Server


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	Mon Jun  2 17:04:39 2008
@@ -256,6 +256,14 @@
     if ($server) {
         require join( '/', split /::/, $server ) . '.pm';
         *{"$pkg\::ISA"} = [$server];
+
+        # clear the environment before every request
+        require HTTP::Server::Simple::CGI;
+        *{"$pkg\::post_accept"} = sub {
+            HTTP::Server::Simple::CGI::Environment->setup_environment;
+            # $self->SUPER::post_accept uses the wrong super package
+            $server->can('post_accept')->(@_);
+        };
     }
     else {
         $self->setup_listener;



More information about the Bps-public-commit mailing list