--- lib/PXElator/httpd.pm 2009/09/10 13:08:36 419 +++ lib/PXElator/httpd.pm 2009/09/13 09:54:35 427 @@ -238,7 +238,7 @@ , 'new_clients' => qq|| ); - foreach my $editable ( 'ip', 'netmask', 'ip_from', 'ip_to', 'domain' ) { + foreach my $editable ( 'ip', 'bcast', 'netmask', 'ip_from', 'ip_to', 'domain' ) { my $v = eval '$server::' . $editable; push @table, ( $editable, qq|| ); } @@ -480,7 +480,21 @@ my $client = $server->accept() || next; # ALARM trickle us my $request = <$client>; - warn "request $request\n" if $debug; + my $headers; + + while ( my $header = <$client> ) { + chomp $header; + last if $header =~ m{^\s*$}; + my ( $n, $v ) = split(/:\s*/, $header); + $headers->{ lc $n } = $v; + } + + if ( my $host = $headers->{host} ) { + $url = 'http://' . $host; + $url .= ":$port" unless $url =~ m{:\d+$}; + } + + warn "## $url ## $request", dump( $headers ) if $debug; if ($request =~ m{^GET (/.*) HTTP/1.[01]}) { my $path = $1;