David Wheeler
2005-10-22 22:17:46 UTC
Masonites,
For this script:
#!/usr/bin/perl -w
use strict;
use Test::More tests => 3;
use CGI qw(-no_debug);
use HTML::Mason::CGIHandler;
$ENV{PATH_INFO} = '/dhandler';
$ENV{REQUEST_METHOD} = 'GET';
my $output;
ok my $cgih = HTML::Mason::CGIHandler->new(
comp_root => shift @ARGV,
out_method => \$output,
), 'Construct CGIHandler object';
$ENV{QUERY_STRING} = 'test=foo';
ok $cgih->handle_request, 'Handle simple callback request';
is $output, 'foo';
__END__
Where /dhandler has only these two lines:
% print STDERR "# dhandler executing\n";
% $m->print($ARGV{test});
Outputs:
1..3
ok 1 - Construct CGIHandler object
# dhandler executing
Content-Type: text/html; charset=ISO-8859-1
ok 2 - Handle simple callback request
not ok 3
# Failed test in /Users/david/bin/try at line 19.
# got: undef
# expected: 'foo'
# Looks like you failed 1 test of 3.
As you can see, the dhandler *is* executing, put the parameter in $ENV
{QUERY_STRING} doesn't seem to be making it into %ARGS. But it's not
a CGI problem because this script passes:
#!/usr/bin/perl -w
use strict;
use Test::More tests => 2;
use CGI qw(-no_debug);
$ENV{PATH_INFO} = '/dhandler';
$ENV{REQUEST_METHOD} = 'GET';
$ENV{QUERY_STRING} = 'test=foo';
ok my $q = CGI->new, 'New CGI';
is $q->param('test'), 'foo', 'Check param';
__END__
HTML::Mason 1.31 and CGI.pm 3.11. Any ideas? Things seem to work fine
in ApacheHandler.
Thanks,
David
For this script:
#!/usr/bin/perl -w
use strict;
use Test::More tests => 3;
use CGI qw(-no_debug);
use HTML::Mason::CGIHandler;
$ENV{PATH_INFO} = '/dhandler';
$ENV{REQUEST_METHOD} = 'GET';
my $output;
ok my $cgih = HTML::Mason::CGIHandler->new(
comp_root => shift @ARGV,
out_method => \$output,
), 'Construct CGIHandler object';
$ENV{QUERY_STRING} = 'test=foo';
ok $cgih->handle_request, 'Handle simple callback request';
is $output, 'foo';
__END__
Where /dhandler has only these two lines:
% print STDERR "# dhandler executing\n";
% $m->print($ARGV{test});
Outputs:
1..3
ok 1 - Construct CGIHandler object
# dhandler executing
Content-Type: text/html; charset=ISO-8859-1
ok 2 - Handle simple callback request
not ok 3
# Failed test in /Users/david/bin/try at line 19.
# got: undef
# expected: 'foo'
# Looks like you failed 1 test of 3.
As you can see, the dhandler *is* executing, put the parameter in $ENV
{QUERY_STRING} doesn't seem to be making it into %ARGS. But it's not
a CGI problem because this script passes:
#!/usr/bin/perl -w
use strict;
use Test::More tests => 2;
use CGI qw(-no_debug);
$ENV{PATH_INFO} = '/dhandler';
$ENV{REQUEST_METHOD} = 'GET';
$ENV{QUERY_STRING} = 'test=foo';
ok my $q = CGI->new, 'New CGI';
is $q->param('test'), 'foo', 'Check param';
__END__
HTML::Mason 1.31 and CGI.pm 3.11. Any ideas? Things seem to work fine
in ApacheHandler.
Thanks,
David