From: Emil Williams Date: Wed, 14 May 2025 18:53:42 +0000 (-0600) Subject: -- X-Git-Url: https://git.xolatile.top/?a=commitdiff_plain;h=c382b56b846d3def111cd392174a055c5236fe01;p=emil-3chen.org.git -- --- diff --git a/perl/Triple.pm b/perl/Triple.pm index f18122a..bf3b4a8 100644 --- a/perl/Triple.pm +++ b/perl/Triple.pm @@ -48,14 +48,23 @@ sub Triple::main { while($request->Accept() >= 0) { - $vars->{"ip"} = $ENV{'REMOTE_ADDR'} || '?', - $vars->{"uri"} = $ENV{'REQUEST_URI'} // '/', + $vars->{"ip"} = $ENV{'REMOTE_ADDR'} || '?'; + $vars->{"uri"} = $ENV{'REQUEST_URI'} // '/'; + my $method = $ENV{'REQUEST_METHOD'} || ''; + my $content_length = $ENV{'CONTENT_LENGTH'} || 0; + my $content_type = $ENV{'CONTENT_TYPE'} || ''; + + my $body = ''; + if ($method eq 'POST' && $content_length > 0) { + read(STDIN, $body, $content_length); + } my $cgi = CGI->new; print $cgi->header( -Content_Type => 'text/html', -charset => 'UTF-8', + -status => '', ); my $page = $static{$vars->{uri}};