Subject: | Incorrect setup() method |
The setup() method in HTTP::Server::Simple has been coded incorrectly.
It currently looks like this:
sub setup {
my ($self) = @_;
while ( my ( $item, $value ) = splice @_, 0, 2 ) {
$self->$item($value) if $self->can($item);
}
}
Because $self is not shifted off @_ the while(splice) goes through the
list of key-value pairs incorrectly and none of the methods ever get called.
I suspect this hasn't been spotted before as most people will be
subclassing HTTP::Server::Simple::CGI which overrides the setup() method.
Attached is a patch against 0.18.
Thanks,
Stephen Quinney
Subject: | HTTP-Server-Simple.patch |
--- lib/HTTP/Server/Simple.pm.orig 2006-06-13 14:09:43.510106000 +0100
+++ lib/HTTP/Server/Simple.pm 2006-06-13 14:28:45.494574000 +0100
@@ -421,7 +421,7 @@
=cut
sub setup {
- my ($self) = @_;
+ my $self = shift @_;
while ( my ( $item, $value ) = splice @_, 0, 2 ) {
$self->$item($value) if $self->can($item);
}