--- Coro/myhttpd/httpd.pl 2001/09/14 12:38:18 1.44 +++ Coro/myhttpd/httpd.pl 2001/11/11 03:32:19 1.45 @@ -185,7 +185,9 @@ my ($self, $code, $msg, $hdr, $content) = @_; my $res = "HTTP/1.1 $code $msg\015\012"; - $self->{h}{connection} = "close" if $hdr->{Connection} =~ /close/; + $self->{h}{connection} = "close" + if exists $hdr->{Connection} # to avoid "empty" header lines due to vivification + and $hdr->{Connection} =~ /close/; $res .= "Date: $HTTP_NOW\015\012"; @@ -422,7 +424,8 @@ or $self->err(304, "not modified"); if (-r "$path/index.html") { - $self->{path} .= "/index.html"; + # replace directory "size" by index.html filesize + $self->{stat}[7] = (stat ($self->{path} .= "/index.html"))[7]; $self->handle_file; } else { $self->handle_dir;