No, its a bug in the test suite, it doesn't specify localhost or 127.0.0.1 but uses the default, which is 0.0.0.0, which is fine for the module but not for the test suite.
If you don't have a personal firewall, windows will happily let you create an internet accessible webserver, which is why test suites need to specify localhost, you can't rely on secure linux semantics.
I've even gone as far as to disable my internet net stop "dhcp client" when installing modules since my personal firewall broke.
Here is what I used (apply with patch -p1 < thepatch.patch from within HTTP-Server-Simple--- directory)
diff -ruN HTTP-Server-Simple-0.43/t/00smoke.t HTTP-Server-Simple-0.430
+1/t/00smoke.t
--- HTTP-Server-Simple-0.43/t/00smoke.t 2008-02-15 09:37:12.0000000
+00 -0800
+++ HTTP-Server-Simple-0.4301/t/00smoke.t 2011-03-05 06:55:12.00000
+0000 -0800
@@ -2,7 +2,7 @@
use_ok(HTTP::Server::Simple);
ok(HTTP::Server::Simple->can('new'), 'can new()');
-my $s= HTTP::Server::Simple->new();
+my $s= HTTP::Server::Simple->new();; $s->host('127.0.0.1');
isa_ok($s,'HTTP::Server::Simple');
is($s->port(),8080,'Defaults to 8080');
is($s->port(13432),13432,'Can change port');
diff -ruN HTTP-Server-Simple-0.43/t/01live.t HTTP-Server-Simple-0.4301
+/t/01live.t
--- HTTP-Server-Simple-0.43/t/01live.t 2010-04-02 09:53:07.00000000
+0 -0700
+++ HTTP-Server-Simple-0.4301/t/01live.t 2011-03-05 06:55:12.000000
+000 -0800
@@ -19,7 +19,7 @@
use base qw(HTTP::Server::Simple::CGI);
sub setup_listener {
- my $self = shift;
+ my $self = shift;; $self ->host('127.0.0.1');
$self->SUPER::setup_listener();
sleep 2;
}
@@ -38,7 +38,7 @@
{
- my $s=HTTP::Server::Simple::CGI->new($PORT);
+ my $s=HTTP::Server::Simple::CGI->new($PORT);; $s->host('127.0.0.
+1');
$s->host("localhost");
my $pid=$s->background();
diag("started server PID='$pid'") if ($ENV{'TEST_VERBOSE'});
@@ -111,7 +111,7 @@
sub run_server_tests {
my $class = shift;
- my $s = $class->new($PORT);
+ my $s = $class->new($PORT);; $s ->host('127.0.0.1');
is($s->port(),$PORT,"Constructor set port correctly");
my $pid=$s->background();
diff -ruN HTTP-Server-Simple-0.43/t/04cgi.t HTTP-Server-Simple-0.4301/
+t/04cgi.t
--- HTTP-Server-Simple-0.43/t/04cgi.t 2010-02-04 12:23:19.000000000
+ -0800
+++ HTTP-Server-Simple-0.4301/t/04cgi.t 2011-03-05 07:04:19.0000000
+00 -0800
@@ -5,12 +5,12 @@
plan tests => 23;
my $PORT = 40000 + int(rand(10000));
-my $host = gethostbyaddr(inet_aton('localhost'), AF_INET);
+$main::host = gethostbyaddr(inet_aton('localhost'), AF_INET) || 'loca
+lhost';
my %methods=(
- url => "url: http://$host:".$PORT,
+ url => "url: http://${main::host}:$PORT",
path_info => 'path_info: /cgitest/path_info',
- server_name => "server_name: $host",
+ server_name => "server_name: $main::host",
server_port => 'server_port: '.$PORT,
server_software => 'server_software: HTTP::Server::Simp
+le/\d+.\d+',
request_method => 'request_method: GET',
@@ -18,12 +18,12 @@
);
my %envvars=(
- SERVER_URL => "SERVER_URL: http://$host:".$PORT.'/',
+ SERVER_URL => "SERVER_URL: http://${main::host}:$PORT/"
+,
SERVER_PORT => 'SERVER_PORT: '.$PORT,
REQUEST_METHOD => 'REQUEST_METHOD: GET',
REQUEST_URI => 'REQUEST_URI: /cgitest/REQUEST_URI',
SERVER_PROTOCOL => 'SERVER_PROTOCOL: HTTP/1.1',
- SERVER_NAME => "SERVER_NAME: $host",
+ SERVER_NAME => "SERVER_NAME: $main::host",
SERVER_SOFTWARE => 'SERVER_SOFTWARE: HTTP::Server::Simp
+le/\d+.\d+',
REMOTE_ADDR => 'REMOTE_ADDR: 127.0.0.1',
QUERY_STRING => 'QUERY_STRING: ',
@@ -31,7 +31,7 @@
);
{
- my $server=CGIServer->new($PORT);
+ my $server=CGIServer->new($PORT);; $server->host( $main::host );
is($server->port(),$PORT,'Constructor set port correctly');
sleep(3); # wait just a moment
@@ -132,7 +132,7 @@
use Env;
sub handle_request {
- my $self=shift;
+ my $self=shift;; $self->host($main::host );
my $cgi=shift;