From 6c294352dcd2ab34acef26c65be5fc048f272a1d Mon Sep 17 00:00:00 2001 From: Emil Williams Date: Sat, 17 May 2025 12:59:55 -0600 Subject: [PATCH] -- --- perl/Triple.pm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/perl/Triple.pm b/perl/Triple.pm index d2761ab..7c4ee67 100644 --- a/perl/Triple.pm +++ b/perl/Triple.pm @@ -96,9 +96,6 @@ sub Triple::main { 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'} // '/'; @@ -107,7 +104,7 @@ sub Triple::main { 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"); @@ -126,10 +123,14 @@ sub Triple::main { $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 ''; -- 2.39.5