while($request->Accept() >= 0) {
my $cgi = CGI->new;
+ my $header = CGI::Header->new($cgi);
+ $header->type('text/html');
+ $header->charset('utf-8');
$vars->{"ip"} = $ENV{'REMOTE_ADDR'} || '?';
$vars->{"uri"} = $ENV{'REQUEST_URI'} // '/';
$location = $vars->{"uri"};
}
- $cgi->header->location = $location if $location;
+ $header->location = $location;
+ $header->status = $status;
- print $cgi->header(
- -Content_Type => 'text/html',
- -charset => 'UTF-8',
- -status => $status,
- );
+ print $header->as_string();
next if $status ne '';