X-Git-Url: https://git.treefish.org/fex.git/blobdiff_plain/7fa382617fbaccc0ce522b2b3adbbee9db5ad227..20150729:/lib/dop diff --git a/lib/dop b/lib/dop index df9511b..9c428a5 100755 --- a/lib/dop +++ b/lib/dop @@ -16,7 +16,7 @@ use Cwd qw(getcwd abs_path); # import from fex.pp our ($bs,$tmpdir,@doc_dirs); -my $log = "$logdir/dop.log"; +my $log = 'dop.log'; # POSIX time format needed for HTTP header setlocale(LC_TIME,'POSIX'); @@ -46,12 +46,10 @@ sub dop { $doc = "$path/$link"; $doc =~ s:/+:/:g; $doc =~ s:^/::; - $host = $ENV{HTTP_HOST} || $hostname; nvt_print( - "HTTP/1.1 301 Moved Permanently", - "Location: $ENV{PROTO}://$host/$doc", + "HTTP/1.1 302 Found", + "Location: /$doc", "Content-Length: 0", - "Connection: close", "" ); &reexec; @@ -307,6 +305,7 @@ sub http_output { if ($type eq 'text/html') { alarm($timeout*10); print $htmldoc; + $s = $size; } else { # binary data # can be stream! seek $file,$seek,0 if $seek; @@ -417,11 +416,6 @@ sub showindex { } -sub mtime { - return (lstat shift)[9]; -} - - sub d3 { local $_ = shift; while (s/(\d)(\d\d\d\b)/$1,$2/) {};