How to get QUERY_STRING in perl mason CGIHandler?

I need to do some maintenance on the Mason site, which worked well on one hosting company, but needs to be moved to another. The new hosting company does not support ApacheHandler, so I am changing the code to CGIHandler.

Unfortunately, I no longer get the QUERY_STRING elements populated in the mason environment, which makes it a little more complicated!

I got the bulk of the handler code here: http://joe.pepersack.net/code/site-mason_handler.pl

The handler is configured as follows:

$h = HTML::Mason::CGIHandler->new(
  comp_root     => $mason_root,
  data_dir      => $mason_data,
  allow_globals => $::MASON_GLOBALS,
  error_mode    => "output",
  default_escape_flags => "h"
);

A general search on the Internet does not return me anything good ...

Does anyone know if there is a difference in the parameter passing between ApacheHandler and CGIHandler? If they are eaten somewhere else, how can I check if CGIHandler found the parameters first?

( ) . -, .

+4
2

. , , $ENV {QUERY_STRING} , apache. , , [QSA], .

0

http://marc.info/?l=mason&m=96320172801620&w=3), $ENV {QUERY_STRING}.

, , Apache:: Request, CGI- ?

http://cpansearch.perl.org/src/JSWARTZ/HTML-Mason-1.46/htdocs/CGIHandler.html:

$r , Apache HTML:: Mason:: ApacheHandler, .

: http://redmine.lighttpd.net/projects/lighttpd/wiki/MasonRecipe/11

### this seems to be necessary as lighttpd does not provide the PATH_INFO and the QUERY_STRING environment variables
## right' way to parse the REQUEST_URI out into PATH_INFO and QUERY_STRING
my $uri = $ENV{REQUEST_URI};
if ($uri =~ /\?/) {
  $uri =~ /^(.*?)\?(.*)/;
  $ENV{PATH_INFO} = $1;
  $ENV{QUERY_STRING} = $2;
} else {
  $ENV{PATH_INFO} = $uri;
  $ENV{QUERY_STRING} = "";
}
+2

Source: https://habr.com/ru/post/1542877/


All Articles