]> git.xolatile.top Git - emil-3chen.org.git/commitdiff
--
authorEmil Williams <emilemilemil@cock.li>
Sat, 17 May 2025 18:59:55 +0000 (12:59 -0600)
committerEmil Williams <emilemilemil@cock.li>
Sat, 17 May 2025 18:59:55 +0000 (12:59 -0600)
perl/Triple.pm

index d2761ab09b9f5ec8bb44ab35ec9c1d5de92510dc..7c4ee672a4ed2918cd0d8dcbd85f949f1f6080b6 100644 (file)
@@ -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 '';