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

index 3d192481ca792fdb2224531fc901ba8a83deaa49..d2761ab09b9f5ec8bb44ab35ec9c1d5de92510dc 100644 (file)
@@ -96,6 +96,9 @@ 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'} // '/';
@@ -123,13 +126,10 @@ sub Triple::main {
             $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 '';