]> git.xolatile.top Git - emil-3chen.org.git/commitdiff
--
authorEmil Williams <emilemilemil@cock.li>
Wed, 14 May 2025 19:30:12 +0000 (13:30 -0600)
committerEmil Williams <emilemilemil@cock.li>
Wed, 14 May 2025 19:30:12 +0000 (13:30 -0600)
perl/Triple.pm

index 114ad45dd8b2a3209e61a7333ba758960c3dfe7d..5b0a4bcc5bac805f7cba7c1bd08629a0ef08773e 100644 (file)
@@ -53,10 +53,15 @@ sub Triple::main {
         my $method         = $ENV{'REQUEST_METHOD'} || '';
         my $content_length = $ENV{'CONTENT_LENGTH'} || 0;
         my $content_type   = $ENV{'CONTENT_TYPE'} || '';
+        my $status         = '';
 
         my $body = '';
-        if ($method eq 'POST' && $content_length > 0) {
-            read(STDIN, $body, $content_length);
+        if ($method eq 'POST') {
+            if ($content_length > 0) {
+                read(STDIN, $body, $content_length);
+            }
+            $status   = '302 Found';
+            $location = $vars->{"uri"};
         }
 
         my $cgi = CGI->new;
@@ -64,7 +69,8 @@ sub Triple::main {
         print $cgi->header(
             -Content_Type => 'text/html',
             -charset      => 'UTF-8',
-            # -status       => 'feed',
+            -status       => $status,
+            -location     => $location,
             );
 
         my $page = $static{$vars->{uri}};