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'} // '/';
my $content_type = $ENV{'CONTENT_TYPE'} || '';
my $body = '';
my $status = '';
- my $location;
+ my $location = '';
if ($method eq 'POST') {
syslog("info", "something like posting has occurred");
$location = $vars->{"uri"};
}
- $header->location = $location;
- $header->status = $status;
+ $cgi->header->location = $location if $location;
- print $header->as_string();
+ print $cgi->header(
+ -Content_Type => 'text/html',
+ -charset => 'UTF-8',
+ -status => $status,
+ -location => $location,
+ );
next if $status ne '';